0

Related question: Text views and image view disappearing from view controller in Xcode 6.1 storyboard

That started happening after the latest update to XCode 6.1 a couple of days ago. I've got a very primitive layout:

enter image description here

If I open the storyboard source code and then switch back to the Interface Builder mode, then all UIImageView dimensions become zeros.

enter image description here

Not depending on whether I can see the UIImageView in the storyboard, it won't appear in the running app. The storyboard and the app worked fine prior to the update to XCode Version 6.1 (6A1052d)

dispatch_async(dispatch_get_main_queue()) {
    self.myImage.sizeToFit()
    let img : UIImage = UIImage(data: imgData.value)!
    self.myImage.image = img
}
Community
  • 1
  • 1
Sergey M
  • 521
  • 4
  • 17

1 Answers1

0

Turns out XCode 6.1 imposes more strict constraints on the storyboard layout (not sure whether it is a bug or a feature).

Here are the steps which worked for me.

Storyboard view

enter image description here

Constraints

enter image description here

UIImageView content mode

enter image description here

Prior to XCode 6.1 I didn't have any specific constraints on the UIImageView. With XCode 6.1 it looks like the constraints are not optional any more.

Sergey M
  • 521
  • 4
  • 17