Created
July 31, 2018 00:35
-
-
Save CreatureSurvive/db1d000482513a87a6abe237af48361e to your computer and use it in GitHub Desktop.
return a custom image based on the name of the requested image within a bundle. this should only be used when filtering a specific app in your bundle filter plist
This file contains hidden or 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
| %hook UIImage | |
| // you should not include the file extention or scale in the file name for this to work | |
| // I have not tested this, but it should work for any image being loaded from the bundle | |
| // baseNameOfLaunchscreenImage@2x.png -> baseNameOfLaunchscreenImage | |
| + (UIImage *)imageNamed: (NSString *)name { | |
| if ([name containsString:@"baseNameOfLaunchscreenImage"]) { | |
| return [UIImage imageWithContentsOfFile:@"/User/Documents/CustomLaunchImage.png"]; | |
| } | |
| return %orig; | |
| } | |
| + (UIImage *)imageNamed:(NSString *)name inBundle:(NSBundle *)bundle compatibleWithTraitCollection:(UITraitCollection *)traitCollection { | |
| if ([name containsString:@"baseNameOfLaunchscreenImage"]) { | |
| return [UIImage imageWithContentsOfFile:@"/User/Documents/CustomLaunchImage.png"]; | |
| } | |
| return %orig; | |
| } | |
| %end |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment