Skip to content

Commit

Permalink
Merge pull request #11 from jrapoport/master
Browse files Browse the repository at this point in the history
Be kind to < iOS7
  • Loading branch information
Neeeo committed Mar 1, 2016
2 parents e739bcd + 4762a9d commit 634c0a9
Showing 1 changed file with 6 additions and 3 deletions.
9 changes: 6 additions & 3 deletions AWLThemeManager/AWLThemeManager.m
Original file line number Diff line number Diff line change
Expand Up @@ -141,18 +141,21 @@ - (UIImage *)imageNamed:(NSString *)key forTheme:(NSString*)themeName
if (NSFoundationVersionNumber >= NSFoundationVersionNumber_iOS_8_0) {
img = [UIImage imageNamed:key inBundle:bundle compatibleWithTraitCollection:nil];
}
else {
#ifdef AWLThemeManager_XCASSETS_iOS7
else {
//This is included for reference/completeness. It fetches the device specific
//image from the compiled Assets.car embedded in the theme bundle for iOS7 devices.
//However, it is a *PRIVATE API*
//As such, all relevant warnings and caveats apply to it's usage
//IF you want to enable with cocoapods you'll need this:
//https://guides.cocoapods.org/syntax/podfile.html#post_install
static NSString* iOS7PrivateCompatSelector = @"_" @"device" @"Specific" @"ImageNamed:" @"inBundle:";
img = [UIImage performSelector:NSSelectorFromString(iOS7PrivateCompatSelector) withObject:imgName withObject:bundle];
#endif
SEL deviceImageNamed = NSSelectorFromString(iOS7PrivateCompatSelector);
if ([UIImage respondsToSelector: deviceImageNamed]) {
img = [UIImage performSelector: deviceImageNamed withObject:imgName withObject:bundle];
}
}
#endif

if (img == nil) {
NSString *path = self.themeList[themeName];
Expand Down

0 comments on commit 634c0a9

Please sign in to comment.