0

I have FirstViewController used to identify user. After user writes data and presses button, request goes to server, if response if positive, I want to open SecondViewController, which contains UIImageView (it's image is declared in Assets).

So when I try to

self.performSegueWithIdentifier("openSecond", sender: self)

UIImageView is empty. After some time image loads by itself (or if I switch its Highlighted parameter).

If I try to open SecondViewController by button click (using same segue, but from InterfaceBuilder) it opens immediately and the UIImageView shows its image.

There is my UIImageView configuration: UIImageView configuration

How can I fix this?

Fr0stDev1
  • 143
  • 2
  • 15

1 Answers1

1

You should try this :

dispatch_async(dispatch_get_main_queue(),{
    self.performSegueWithIdentifier(mysegueIdentifier,sender: self)
})

Some people ran into this kind of problem, however I cannot explain the real reason for this. Comments and edits welcome.

Community
  • 1
  • 1
H4Hugo
  • 2,570
  • 3
  • 16
  • 32