Posts

Post not yet marked as solved
0 Replies
318 Views
We're having some difficulties getting UIImage(named:,in:,compatibleWith:) to return the appropriate image from an image asset in an asset catalog.To reproduce, under Xcode 11 and iPad OS: create a new Image asset in an asset catalog. Set it to have images for iPhone and iPad (not Universal) idiom, and Any, Dark for interface style. Set image scales to Single scale. Set the resultant four images, ensuring that they are all visually dissimilar for testing purposes. All other traits for the image asset should be Any.In code, manually create a trait collection that has an idiom of either phone or pad, and a style of either light or dark. Attempt to load the image in code. The resultant image will only be correct in one of the four cases. In our main app, Procreate, it fails to find an image for pad (light or dark), and loads only the light image for phone. In a trivial test app I made, it fails to load an image for phone, and only loads the light image for pad.The expected result would be that the asset loads the correct image for the traits passed in. Has anyone here experienced something similar?
Posted
by pipeline.
Last updated
.