I'd like to display the app icon inside my app. The icon is in the default assets catalog (Images.xcassets
).
How do you load it? I tried the following and they all return nil
:
image = [UIImage imageNamed:@"AppIcon"]; image = [UIImage imageNamed:@"icon"]; image = [UIImage imageNamed:@"icon-76"]; image = [UIImage imageNamed:@"icon-60"];
Other images in the assets catalog work as expected.
By inspecting the bundle I found that the icon images were renamed as:
AppIcon76x76~ipad.png AppIcon76x76@2x~ipad.png [email protected]
And so on.
Thus, using [UIImage imageNamed:@"AppIcon76x76"]
or similar works.
Is this documented somewhere?
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