After updating xcode all images in the storyboard appeared as question marks (as it doesn\'t find them). I tried to remove/add them, cleared derived data but still all image
I had the same problem and I found out that it's because I don't have the image in the size that corresponds to the "View as" device selected in storyboard (bottom left).
If you've selected a device that needs the @2x image (example: iPhone 6s) and you only have the @3x image (as I did) you will see the question mark. If you add the size for the image that corresponds to the device size that you are using for storyboard, the image will appear in your imageView.
Basically, you want to have the image in all 3 sizes: @1x, @2x and @3x.
Well I was in the same situation and came to know that xcode 8 storyboard removes frames and that is why images are not showing. Therefore you have to put appropriate constraints on uiimageviews and then you have to force constraints on by writing this code.
UIImageView *uiv = [cell viewWithTag:100];
[uiv setNeedsUpdateConstraints];
[uiv setNeedsLayout];
[uiv layoutIfNeeded];
This is not an issue if you run your project and your image displays in simulator. Sometime is you change size classes
then also this happens.
for example if you are using multiple size class like wA,hA
and wC,hr
and you set constraints for any,any
and compact,regular
both and if you keep any,any
selected in interfacebulder then it will show images properly but if you change it to compact,regular
then it will shoe question mark
because of simulated metrics's size
. So, if it is not affecting output then it is not an issue!
If you have only 3x images in your Assets that you want to work with and you have already Chosen the Initial Device View to some 2x device, then do the following:
You have to use xcassets catalog for your images:
1) Access Assets.xcassets
2) Create new Image Set or choose from the list and update existing one
3) Place your image variants in its @1x, @2x and @3x sizes:
Call your image in your code like:
let image = UIImage(named: "NewImageName")