Skip to content

Instantly share code, notes, and snippets.

@Muirey03
Created June 29, 2019 13:47
Show Gist options
  • Save Muirey03/6ed5107f11ba9c53c596e50d5b48f5ad to your computer and use it in GitHub Desktop.
Save Muirey03/6ed5107f11ba9c53c596e50d5b48f5ad to your computer and use it in GitHub Desktop.
Fetch an image from UIKit/UIKitCore
UIImage* UIKitImage(NSString* imgName)
{
NSString* artworkPath = @"/System/Library/PrivateFrameworks/UIKitCore.framework/Artwork.bundle";
NSBundle* artworkBundle = [NSBundle bundleWithPath:artworkPath];
if (!artworkBundle)
{
artworkPath = @"/System/Library/Frameworks/UIKit.framework/Artwork.bundle";
artworkBundle = [NSBundle bundleWithPath:artworkPath];
}
UIImage* img = [UIImage imageNamed:imgName inBundle:artworkBundle];
return [img imageWithRenderingMode:UIImageRenderingModeAlwaysTemplate];
}
@Muirey03
Copy link
Author

You can find a list of images to use here: https://github.com/gmawji/ios10-artwork/tree/master/%403x/com.apple.uikit.Artwork. For example, UIKitImage(@"UIButtonBarPlay"); would get you the play button image.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment