the Reverend the Reverend - 1 year ago 100
iOS Question

How to get the current application icon in ios

Is there a way to get the current application icon in a cocoa-touch app?
Thank you.

Answer Source

I based my answer completely on moosgummi's, but returning a UIImage instead.

UIImage *appIcon = [UIImage imageNamed: [[[[NSBundle mainBundle] infoDictionary] objectForKey:@"CFBundleIconFiles"] objectAtIndex:0]];

The UIImage automatically selects the suitable version (normal, @2x, ~ipad, ~ipad@2x or any future suffix). (BTW, don't you just hate this stupid scheme for identifying versions of images? It was just getting out of hand. Thank god for Asset Catalogues!)

Recommended from our users: Dynamic Network Monitoring from WhatsUp Gold from IPSwitch. Free Download