File tree Expand file tree Collapse file tree 2 files changed +12
-0
lines changed
ThemeManagerDemo/ThemeManagerDemo.xcodeproj Expand file tree Collapse file tree 2 files changed +12
-0
lines changed Original file line number Diff line number Diff line change @@ -121,8 +121,10 @@ - (UIImage *)imageNamed:(NSString *)imgName forTheme:(NSString*)themeName
121121 }
122122
123123 NSString *path = self.themeList [themeName];
124+ path = [self relativePathToMainBundle: path];
124125 NSString *filePath = [path stringByAppendingPathComponent: imgName];
125126 UIImage *img = [UIImage imageNamed: filePath];
127+
126128 if (img == nil ) {
127129 NSString *baseTheme = self.themeRelationship [themeName];
128130 img = [self imageNamed: imgName forTheme: baseTheme];
@@ -131,6 +133,14 @@ - (UIImage *)imageNamed:(NSString *)imgName forTheme:(NSString*)themeName
131133 return img;
132134}
133135
136+ - (NSString *)relativePathToMainBundle : (NSString *)path
137+ {
138+ NSString *mainBundlePath = [[NSBundle mainBundle ] bundlePath ];
139+ NSString *appDirectory = [mainBundlePath stringByDeletingLastPathComponent ];
140+ NSString *relativePath = [path stringByReplacingOccurrencesOfString: appDirectory withString: @" .." ];
141+ return relativePath;
142+ }
143+
134144- (UIFont *)fontForKey : (NSString *)key
135145{
136146 return [self fontForKey: key forTheme: self .currentTheme];
Original file line number Diff line number Diff line change 367367 buildSettings = {
368368 ASSETCATALOG_COMPILER_APPICON_NAME = AppIcon;
369369 INFOPLIST_FILE = ThemeManagerDemo/Info.plist;
370+ IPHONEOS_DEPLOYMENT_TARGET = 7.0;
370371 LD_RUNPATH_SEARCH_PATHS = "$(inherited) @executable_path/Frameworks";
371372 PRODUCT_NAME = "$(TARGET_NAME)";
372373 };
377378 buildSettings = {
378379 ASSETCATALOG_COMPILER_APPICON_NAME = AppIcon;
379380 INFOPLIST_FILE = ThemeManagerDemo/Info.plist;
381+ IPHONEOS_DEPLOYMENT_TARGET = 7.0;
380382 LD_RUNPATH_SEARCH_PATHS = "$(inherited) @executable_path/Frameworks";
381383 PRODUCT_NAME = "$(TARGET_NAME)";
382384 };
You can’t perform that action at this time.
0 commit comments