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:
If I open the storyboard source code and then switch back to the Interface Builder mode, then all UIImageView dimensions become zeros.
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
}
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
Constraints
UIImageView content mode
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.
The technical post webpages of this site follow the CC BY-SA 4.0 protocol. If you need to reprint, please indicate the site URL or the original address.Any question please contact:yoyou2525@163.com.