File tree Expand file tree Collapse file tree 1 file changed +6
-3
lines changed
Expand file tree Collapse file tree 1 file changed +6
-3
lines changed Original file line number Diff line number Diff line change @@ -141,18 +141,21 @@ - (UIImage *)imageNamed:(NSString *)key forTheme:(NSString*)themeName
141141 if (NSFoundationVersionNumber >= NSFoundationVersionNumber_iOS_8_0) {
142142 img = [UIImage imageNamed: key inBundle: bundle compatibleWithTraitCollection: nil ];
143143 }
144- else {
145144#ifdef AWLThemeManager_XCASSETS_iOS7
145+ else {
146146 // This is included for reference/completeness. It fetches the device specific
147147 // image from the compiled Assets.car embedded in the theme bundle for iOS7 devices.
148148 // However, it is a *PRIVATE API*
149149 // As such, all relevant warnings and caveats apply to it's usage
150150 // IF you want to enable with cocoapods you'll need this:
151151 // https://guides.cocoapods.org/syntax/podfile.html#post_install
152152 static NSString * iOS7PrivateCompatSelector = @" _" @" device" @" Specific" @" ImageNamed:" @" inBundle:" ;
153- img = [UIImage performSelector: NSSelectorFromString (iOS7PrivateCompatSelector) withObject: imgName withObject: bundle];
154- #endif
153+ SEL deviceImageNamed = NSSelectorFromString (iOS7PrivateCompatSelector);
154+ if ([UIImage respondsToSelector: deviceImageNamed]) {
155+ img = [UIImage performSelector: deviceImageNamed withObject: imgName withObject: bundle];
156+ }
155157 }
158+ #endif
156159
157160 if (img == nil ) {
158161 NSString *path = self.themeList [themeName];
You can’t perform that action at this time.
0 commit comments