Is there a way I can say for a particular UIImageView:
UIImageView *imageView = <#instantiate#>
imageView.image = @"someImageFromImageAsset";
and based on the device it's rendering on, it sets the right image. Obviously I need to set the image for a particular device but I am unsure how you do it.
iOS will automatically choose the correct sized image if you just use the name of the image. Use @2x in the image file name for retina display.
Objective-C
imageView.image = [UIImage imageNamed: @"someImageName"];
Swift
imageView.image = UIImage(named: "someImageName");
If you love us? You can donate to us via Paypal or buy me a coffee so we can maintain and grow! Thank you!
Donate Us With