Created
June 29, 2019 13:47
-
-
Save Muirey03/6ed5107f11ba9c53c596e50d5b48f5ad to your computer and use it in GitHub Desktop.
Fetch an image from UIKit/UIKitCore
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
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]; | |
} |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
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.