Skip to content

Commit fa7ecc4

Browse files
committed
add xcasset bundle
1 parent 11e7cce commit fa7ecc4

File tree

9 files changed

+200
-4
lines changed

9 files changed

+200
-4
lines changed

AWLThemeManager.podspec

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -16,7 +16,7 @@ Pod::Spec.new do |s|
1616
#
1717

1818
s.name = "AWLThemeManager"
19-
s.version = "1.0.3"
19+
s.version = "1.0.4"
2020
s.summary = "AWLThemeManager is a lightweight theme manager for iOS."
2121
s.homepage = "https://github.com/appwilldev/AWLThemeManager"
2222
# s.screenshots = "www.example.com/screenshots_1.gif", "www.example.com/screenshots_2.gif"

ThemeManagerDemo/Assets/Info.plist

Lines changed: 28 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,28 @@
1+
<?xml version="1.0" encoding="UTF-8"?>
2+
<!DOCTYPE plist PUBLIC "-//Apple//DTD PLIST 1.0//EN" "http://www.apple.com/DTDs/PropertyList-1.0.dtd">
3+
<plist version="1.0">
4+
<dict>
5+
<key>CFBundleDevelopmentRegion</key>
6+
<string>en</string>
7+
<key>CFBundleExecutable</key>
8+
<string>$(EXECUTABLE_NAME)</string>
9+
<key>CFBundleIdentifier</key>
10+
<string>$(PRODUCT_BUNDLE_IDENTIFIER)</string>
11+
<key>CFBundleInfoDictionaryVersion</key>
12+
<string>6.0</string>
13+
<key>CFBundleName</key>
14+
<string>$(PRODUCT_NAME)</string>
15+
<key>CFBundlePackageType</key>
16+
<string>BNDL</string>
17+
<key>CFBundleShortVersionString</key>
18+
<string>1.0</string>
19+
<key>CFBundleSignature</key>
20+
<string>????</string>
21+
<key>CFBundleVersion</key>
22+
<string>1</string>
23+
<key>NSHumanReadableCopyright</key>
24+
<string>Copyright © 2016年 AppWill. All rights reserved.</string>
25+
<key>NSPrincipalClass</key>
26+
<string></string>
27+
</dict>
28+
</plist>

ThemeManagerDemo/ThemeManagerDemo.xcodeproj/project.pbxproj

Lines changed: 131 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -17,6 +17,9 @@
1717
9EB336A919F01C2600C82FD3 /* LaunchScreen.xib in Resources */ = {isa = PBXBuildFile; fileRef = 9EB336A719F01C2600C82FD3 /* LaunchScreen.xib */; };
1818
9EB336B519F01C2600C82FD3 /* ThemeManagerDemoTests.m in Sources */ = {isa = PBXBuildFile; fileRef = 9EB336B419F01C2600C82FD3 /* ThemeManagerDemoTests.m */; };
1919
9EB336C119F01CAC00C82FD3 /* AWLThemeManager.m in Sources */ = {isa = PBXBuildFile; fileRef = 9EB336C019F01CAC00C82FD3 /* AWLThemeManager.m */; };
20+
B5410EA41C853269006203C9 /* Media.xcassets in Resources */ = {isa = PBXBuildFile; fileRef = B5410EA31C853269006203C9 /* Media.xcassets */; };
21+
B5410EA91C853541006203C9 /* defaults.plist in Resources */ = {isa = PBXBuildFile; fileRef = B5410EA81C853541006203C9 /* defaults.plist */; };
22+
B5410EAC1C85358F006203C9 /* Assets.bundle in Resources */ = {isa = PBXBuildFile; fileRef = B5410E9D1C853236006203C9 /* Assets.bundle */; };
2023
/* End PBXBuildFile section */
2124

2225
/* Begin PBXContainerItemProxy section */
@@ -27,6 +30,13 @@
2730
remoteGlobalIDString = 9EB3369419F01C2600C82FD3;
2831
remoteInfo = ThemeManagerDemo;
2932
};
33+
B5410EAA1C853581006203C9 /* PBXContainerItemProxy */ = {
34+
isa = PBXContainerItemProxy;
35+
containerPortal = 9EB3368D19F01C2600C82FD3 /* Project object */;
36+
proxyType = 1;
37+
remoteGlobalIDString = B5410E9C1C853236006203C9;
38+
remoteInfo = Assets;
39+
};
3040
/* End PBXContainerItemProxy section */
3141

3242
/* Begin PBXFileReference section */
@@ -47,6 +57,10 @@
4757
9EB336B419F01C2600C82FD3 /* ThemeManagerDemoTests.m */ = {isa = PBXFileReference; lastKnownFileType = sourcecode.c.objc; path = ThemeManagerDemoTests.m; sourceTree = "<group>"; };
4858
9EB336BF19F01CAC00C82FD3 /* AWLThemeManager.h */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.c.h; path = AWLThemeManager.h; sourceTree = "<group>"; };
4959
9EB336C019F01CAC00C82FD3 /* AWLThemeManager.m */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.c.objc; path = AWLThemeManager.m; sourceTree = "<group>"; };
60+
B5410E9D1C853236006203C9 /* Assets.bundle */ = {isa = PBXFileReference; explicitFileType = wrapper.cfbundle; includeInIndex = 0; path = Assets.bundle; sourceTree = BUILT_PRODUCTS_DIR; };
61+
B5410E9F1C853236006203C9 /* Info.plist */ = {isa = PBXFileReference; lastKnownFileType = text.plist.xml; path = Info.plist; sourceTree = "<group>"; };
62+
B5410EA31C853269006203C9 /* Media.xcassets */ = {isa = PBXFileReference; lastKnownFileType = folder.assetcatalog; path = Media.xcassets; sourceTree = "<group>"; };
63+
B5410EA81C853541006203C9 /* defaults.plist */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = text.plist.xml; path = defaults.plist; sourceTree = "<group>"; };
5064
/* End PBXFileReference section */
5165

5266
/* Begin PBXFrameworksBuildPhase section */
@@ -64,6 +78,13 @@
6478
);
6579
runOnlyForDeploymentPostprocessing = 0;
6680
};
81+
B5410E9A1C853236006203C9 /* Frameworks */ = {
82+
isa = PBXFrameworksBuildPhase;
83+
buildActionMask = 2147483647;
84+
files = (
85+
);
86+
runOnlyForDeploymentPostprocessing = 0;
87+
};
6788
/* End PBXFrameworksBuildPhase section */
6889

6990
/* Begin PBXGroup section */
@@ -73,6 +94,7 @@
7394
9EB336BE19F01C4900C82FD3 /* AWLThemeManager */,
7495
9EB3369719F01C2600C82FD3 /* ThemeManagerDemo */,
7596
9EB336B119F01C2600C82FD3 /* ThemeManagerDemoTests */,
97+
B5410E9E1C853236006203C9 /* Assets */,
7698
9EB3369619F01C2600C82FD3 /* Products */,
7799
);
78100
sourceTree = "<group>";
@@ -82,13 +104,15 @@
82104
children = (
83105
9EB3369519F01C2600C82FD3 /* ThemeManagerDemo.app */,
84106
9EB336AE19F01C2600C82FD3 /* ThemeManagerDemoTests.xctest */,
107+
B5410E9D1C853236006203C9 /* Assets.bundle */,
85108
);
86109
name = Products;
87110
sourceTree = "<group>";
88111
};
89112
9EB3369719F01C2600C82FD3 /* ThemeManagerDemo */ = {
90113
isa = PBXGroup;
91114
children = (
115+
B5410EA71C853415006203C9 /* AssetsBundle */,
92116
0479A2E41AB05A4A00E544E6 /* BaseSample.bundle */,
93117
0479A2E21AB0385E00E544E6 /* Sample.bundle */,
94118
9EB3369C19F01C2600C82FD3 /* AppDelegate.h */,
@@ -139,6 +163,23 @@
139163
path = ../AWLThemeManager;
140164
sourceTree = "<group>";
141165
};
166+
B5410E9E1C853236006203C9 /* Assets */ = {
167+
isa = PBXGroup;
168+
children = (
169+
B5410E9F1C853236006203C9 /* Info.plist */,
170+
);
171+
path = Assets;
172+
sourceTree = "<group>";
173+
};
174+
B5410EA71C853415006203C9 /* AssetsBundle */ = {
175+
isa = PBXGroup;
176+
children = (
177+
B5410EA81C853541006203C9 /* defaults.plist */,
178+
B5410EA31C853269006203C9 /* Media.xcassets */,
179+
);
180+
name = AssetsBundle;
181+
sourceTree = "<group>";
182+
};
142183
/* End PBXGroup section */
143184

144185
/* Begin PBXNativeTarget section */
@@ -153,6 +194,7 @@
153194
buildRules = (
154195
);
155196
dependencies = (
197+
B5410EAB1C853581006203C9 /* PBXTargetDependency */,
156198
);
157199
name = ThemeManagerDemo;
158200
productName = ThemeManagerDemo;
@@ -177,6 +219,23 @@
177219
productReference = 9EB336AE19F01C2600C82FD3 /* ThemeManagerDemoTests.xctest */;
178220
productType = "com.apple.product-type.bundle.unit-test";
179221
};
222+
B5410E9C1C853236006203C9 /* Assets */ = {
223+
isa = PBXNativeTarget;
224+
buildConfigurationList = B5410EA21C853236006203C9 /* Build configuration list for PBXNativeTarget "Assets" */;
225+
buildPhases = (
226+
B5410E991C853236006203C9 /* Sources */,
227+
B5410E9A1C853236006203C9 /* Frameworks */,
228+
B5410E9B1C853236006203C9 /* Resources */,
229+
);
230+
buildRules = (
231+
);
232+
dependencies = (
233+
);
234+
name = Assets;
235+
productName = Assets;
236+
productReference = B5410E9D1C853236006203C9 /* Assets.bundle */;
237+
productType = "com.apple.product-type.bundle";
238+
};
180239
/* End PBXNativeTarget section */
181240

182241
/* Begin PBXProject section */
@@ -193,6 +252,9 @@
193252
CreatedOnToolsVersion = 6.0.1;
194253
TestTargetID = 9EB3369419F01C2600C82FD3;
195254
};
255+
B5410E9C1C853236006203C9 = {
256+
CreatedOnToolsVersion = 7.2;
257+
};
196258
};
197259
};
198260
buildConfigurationList = 9EB3369019F01C2600C82FD3 /* Build configuration list for PBXProject "ThemeManagerDemo" */;
@@ -210,6 +272,7 @@
210272
targets = (
211273
9EB3369419F01C2600C82FD3 /* ThemeManagerDemo */,
212274
9EB336AD19F01C2600C82FD3 /* ThemeManagerDemoTests */,
275+
B5410E9C1C853236006203C9 /* Assets */,
213276
);
214277
};
215278
/* End PBXProject section */
@@ -219,6 +282,7 @@
219282
isa = PBXResourcesBuildPhase;
220283
buildActionMask = 2147483647;
221284
files = (
285+
B5410EAC1C85358F006203C9 /* Assets.bundle in Resources */,
222286
9EB336A419F01C2600C82FD3 /* Main.storyboard in Resources */,
223287
0479A2E51AB05A4A00E544E6 /* BaseSample.bundle in Resources */,
224288
9EB336A919F01C2600C82FD3 /* LaunchScreen.xib in Resources */,
@@ -234,6 +298,15 @@
234298
);
235299
runOnlyForDeploymentPostprocessing = 0;
236300
};
301+
B5410E9B1C853236006203C9 /* Resources */ = {
302+
isa = PBXResourcesBuildPhase;
303+
buildActionMask = 2147483647;
304+
files = (
305+
B5410EA91C853541006203C9 /* defaults.plist in Resources */,
306+
B5410EA41C853269006203C9 /* Media.xcassets in Resources */,
307+
);
308+
runOnlyForDeploymentPostprocessing = 0;
309+
};
237310
/* End PBXResourcesBuildPhase section */
238311

239312
/* Begin PBXSourcesBuildPhase section */
@@ -256,6 +329,13 @@
256329
);
257330
runOnlyForDeploymentPostprocessing = 0;
258331
};
332+
B5410E991C853236006203C9 /* Sources */ = {
333+
isa = PBXSourcesBuildPhase;
334+
buildActionMask = 2147483647;
335+
files = (
336+
);
337+
runOnlyForDeploymentPostprocessing = 0;
338+
};
259339
/* End PBXSourcesBuildPhase section */
260340

261341
/* Begin PBXTargetDependency section */
@@ -264,6 +344,11 @@
264344
target = 9EB3369419F01C2600C82FD3 /* ThemeManagerDemo */;
265345
targetProxy = 9EB336AF19F01C2600C82FD3 /* PBXContainerItemProxy */;
266346
};
347+
B5410EAB1C853581006203C9 /* PBXTargetDependency */ = {
348+
isa = PBXTargetDependency;
349+
target = B5410E9C1C853236006203C9 /* Assets */;
350+
targetProxy = B5410EAA1C853581006203C9 /* PBXContainerItemProxy */;
351+
};
267352
/* End PBXTargetDependency section */
268353

269354
/* Begin PBXVariantGroup section */
@@ -418,6 +503,44 @@
418503
};
419504
name = Release;
420505
};
506+
B5410EA01C853236006203C9 /* Debug */ = {
507+
isa = XCBuildConfiguration;
508+
buildSettings = {
509+
CODE_SIGN_IDENTITY = "-";
510+
COMBINE_HIDPI_IMAGES = YES;
511+
DEBUG_INFORMATION_FORMAT = dwarf;
512+
ENABLE_TESTABILITY = YES;
513+
GCC_NO_COMMON_BLOCKS = YES;
514+
INFOPLIST_FILE = Assets/Info.plist;
515+
INSTALL_PATH = "$(LOCAL_LIBRARY_DIR)/Bundles";
516+
MACOSX_DEPLOYMENT_TARGET = 10.11;
517+
PRODUCT_BUNDLE_IDENTIFIER = com.appwill.Assets;
518+
PRODUCT_NAME = "$(TARGET_NAME)";
519+
SDKROOT = iphoneos;
520+
SKIP_INSTALL = YES;
521+
WRAPPER_EXTENSION = bundle;
522+
};
523+
name = Debug;
524+
};
525+
B5410EA11C853236006203C9 /* Release */ = {
526+
isa = XCBuildConfiguration;
527+
buildSettings = {
528+
CODE_SIGN_IDENTITY = "-";
529+
COMBINE_HIDPI_IMAGES = YES;
530+
COPY_PHASE_STRIP = NO;
531+
DEBUG_INFORMATION_FORMAT = "dwarf-with-dsym";
532+
GCC_NO_COMMON_BLOCKS = YES;
533+
INFOPLIST_FILE = Assets/Info.plist;
534+
INSTALL_PATH = "$(LOCAL_LIBRARY_DIR)/Bundles";
535+
MACOSX_DEPLOYMENT_TARGET = 10.11;
536+
PRODUCT_BUNDLE_IDENTIFIER = com.appwill.Assets;
537+
PRODUCT_NAME = "$(TARGET_NAME)";
538+
SDKROOT = iphoneos;
539+
SKIP_INSTALL = YES;
540+
WRAPPER_EXTENSION = bundle;
541+
};
542+
name = Release;
543+
};
421544
/* End XCBuildConfiguration section */
422545

423546
/* Begin XCConfigurationList section */
@@ -448,6 +571,14 @@
448571
defaultConfigurationIsVisible = 0;
449572
defaultConfigurationName = Release;
450573
};
574+
B5410EA21C853236006203C9 /* Build configuration list for PBXNativeTarget "Assets" */ = {
575+
isa = XCConfigurationList;
576+
buildConfigurations = (
577+
B5410EA01C853236006203C9 /* Debug */,
578+
B5410EA11C853236006203C9 /* Release */,
579+
);
580+
defaultConfigurationIsVisible = 0;
581+
};
451582
/* End XCConfigurationList section */
452583
};
453584
rootObject = 9EB3368D19F01C2600C82FD3 /* Project object */;
Lines changed: 6 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,6 @@
1+
{
2+
"info" : {
3+
"version" : 1,
4+
"author" : "xcode"
5+
}
6+
}
Lines changed: 21 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,21 @@
1+
{
2+
"images" : [
3+
{
4+
"idiom" : "universal",
5+
"scale" : "1x"
6+
},
7+
{
8+
"idiom" : "universal",
9+
"filename" : "[email protected]",
10+
"scale" : "2x"
11+
},
12+
{
13+
"idiom" : "universal",
14+
"scale" : "3x"
15+
}
16+
],
17+
"info" : {
18+
"version" : 1,
19+
"author" : "xcode"
20+
}
21+
}
6.66 KB
Loading

ThemeManagerDemo/ThemeManagerDemo/Sample.bundle/defaults.plist

Lines changed: 0 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -6,7 +6,5 @@
66
<string>SampleTheme</string>
77
<key>AWL_BASE_THEME</key>
88
<string>BaseSampleTheme</string>
9-
<key>Content_Font</key>
10-
<string>bold,17</string>
119
</dict>
1210
</plist>

ThemeManagerDemo/ThemeManagerDemo/ViewController.m

Lines changed: 3 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -20,9 +20,11 @@ - (void)viewDidLoad {
2020

2121
NSString *bundlePath1 = [[NSBundle mainBundle] pathForResource:@"BaseSample" ofType:@"bundle"];
2222
NSString *bundlePath2 = [[NSBundle mainBundle] pathForResource:@"Sample" ofType:@"bundle"];
23+
NSString *bundlePath3 = [[NSBundle mainBundle] pathForResource:@"Assets" ofType:@"bundle"];
2324
AWLThemeManager *mgr = [[AWLThemeManager alloc] init];
2425
[mgr addTheme:bundlePath1];
25-
mgr.currentTheme = [mgr addTheme:bundlePath2];
26+
[mgr addTheme:bundlePath2];
27+
mgr.currentTheme = [mgr addTheme:bundlePath3];
2628
UIImage *img = [mgr imageNamed:@"icon"];
2729
UIImageView *imgView = [[UIImageView alloc] initWithImage:img];
2830
imgView.center = CGPointMake(CGRectGetWidth(self.view.bounds)/2, CGRectGetHeight(self.view.bounds)/2);
Lines changed: 10 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,10 @@
1+
<?xml version="1.0" encoding="UTF-8"?>
2+
<!DOCTYPE plist PUBLIC "-//Apple//DTD PLIST 1.0//EN" "http://www.apple.com/DTDs/PropertyList-1.0.dtd">
3+
<plist version="1.0">
4+
<dict>
5+
<key>AWL_THEME_NAME</key>
6+
<string>AssetsTheme</string>
7+
<key>AWL_BASE_THEME</key>
8+
<string>SampleTheme</string>
9+
</dict>
10+
</plist>

0 commit comments

Comments
 (0)