flip_the_switch 0.4.0 → 1.0.0
Sign up to get free protection for your applications and to get access to all the features.
- checksums.yaml +4 -4
- data/.gitignore +4 -1
- data/.travis.yml +3 -1
- data/CHANGELOG.md +10 -0
- data/Classes/FlipTheSwitch/Shared/FTSFeature.h +11 -0
- data/Classes/FlipTheSwitch/Shared/FTSFeature.m +67 -0
- data/Classes/FlipTheSwitch/Shared/FTSFlipTheSwitch.h +21 -0
- data/Classes/FlipTheSwitch/Shared/FTSFlipTheSwitch.m +144 -0
- data/Classes/FlipTheSwitch/iOS/FTSFeatureCell.h +17 -0
- data/Classes/FlipTheSwitch/iOS/FTSFeatureCell.m +12 -0
- data/Classes/FlipTheSwitch/iOS/FTSFeatureConfigurationViewController.h +5 -0
- data/Classes/FlipTheSwitch/iOS/FTSFeatureConfigurationViewController.m +142 -0
- data/Classes/FlipTheSwitch/iOS/FTSFeatureDescriptionLabel.h +5 -0
- data/Classes/FlipTheSwitch/iOS/FTSFeatureDescriptionLabel.m +13 -0
- data/Example/Colors-OSX/AppDelegate.h +7 -0
- data/Example/Colors-OSX/AppDelegate.m +17 -0
- data/Example/Colors-OSX/Base.lproj/Main.storyboard +744 -0
- data/Example/Colors-OSX/ColoredViews/GreenView.h +5 -0
- data/Example/Colors-OSX/ColoredViews/GreenView.m +12 -0
- data/Example/Colors-OSX/ColoredViews/PurpleView.h +5 -0
- data/Example/Colors-OSX/ColoredViews/PurpleView.m +12 -0
- data/Example/Colors-OSX/ColoredViews/RedView.h +5 -0
- data/Example/Colors-OSX/ColoredViews/RedView.m +12 -0
- data/Example/Colors-OSX/ColoredViews/YellowView.h +5 -0
- data/Example/Colors-OSX/ColoredViews/YellowView.m +12 -0
- data/Example/Colors-OSX/FTSFlipTheSwitch+Features.h +45 -0
- data/Example/Colors-OSX/FTSFlipTheSwitch+Features.m +165 -0
- data/Example/Colors-OSX/Features.plist +39 -0
- data/Example/Colors-OSX/Images.xcassets/AppIcon.appiconset/Contents.json +58 -0
- data/Example/Colors-OSX/Info.plist +32 -0
- data/Example/Colors-OSX/Settings.bundle/Features.plist +59 -0
- data/Example/Colors-OSX/Settings.bundle/Root.plist +23 -0
- data/Example/Colors-OSX/ViewController.h +14 -0
- data/Example/Colors-OSX/ViewController.m +152 -0
- data/Example/Colors-OSX/main.m +5 -0
- data/Example/Colors-iOS/Base.lproj/Main.storyboard +111 -0
- data/Example/Colors-iOS/Colors-iOS-Info.plist +2 -2
- data/Example/Colors-iOS/FTSFlipTheSwitch+Features.h +45 -0
- data/Example/Colors-iOS/FTSFlipTheSwitch+Features.m +165 -0
- data/Example/Colors-iOS/Images.xcassets/AppIcon.appiconset/Contents.json +15 -0
- data/Example/Colors-iOS/ViewControlleriOS.m +55 -20
- data/Example/Colors.xcodeproj/project.pbxproj +273 -25
- data/Example/Colors.xcodeproj/xcshareddata/xcschemes/Colors-OSX.xcscheme +115 -0
- data/Example/Colors.xcodeproj/xcshareddata/xcschemes/Colors-iOS.xcscheme +9 -15
- data/Example/FTSFlipTheSwitch+Features.h +45 -0
- data/Example/FTSFlipTheSwitch+Features.m +165 -0
- data/Example/Features.plist +39 -0
- data/Example/Gemfile +4 -0
- data/Example/Podfile +11 -2
- data/Example/README.md +13 -0
- data/Example/Rakefile +5 -1
- data/Example/features.json +23 -0
- data/FlipTheSwitch.podspec +9 -4
- data/Gemfile +2 -1
- data/README.md +101 -21
- data/Resources/FlipTheSwitch/FlipTheSwitch.storyboard +208 -0
- data/Tests/FlipTheSwitchSpec-iOS/Features.plist +6 -1
- data/Tests/{FlipTheSwitchSpec-Mac/Features.plist → FlipTheSwitchSpec-iOS/OtherFeatures.plist} +5 -2
- data/Tests/FlipTheSwitchSpec.xcodeproj/project.pbxproj +101 -38
- data/Tests/FlipTheSwitchSpec.xcodeproj/xcshareddata/xcschemes/FlipTheSwitchSpec-Mac.xcscheme +9 -7
- data/Tests/FlipTheSwitchSpec.xcodeproj/xcshareddata/xcschemes/FlipTheSwitchSpec-iOS.xcscheme +9 -7
- data/Tests/Rakefile +1 -1
- data/Tests/Spec/Classes/FlipTheSwitch/FlipTheSwitchSpec.m +134 -28
- data/flip_the_switch.gemspec +2 -1
- data/images/feature_configuration_screen.png +0 -0
- data/lib/flip_the_switch.rb +2 -0
- data/lib/flip_the_switch/cli.rb +16 -24
- data/lib/flip_the_switch/environment.rb +11 -0
- data/lib/flip_the_switch/feature.rb +11 -0
- data/lib/flip_the_switch/generator/base.rb +3 -3
- data/lib/flip_the_switch/generator/category.rb +13 -5
- data/lib/flip_the_switch/generator/header.h.erb +15 -8
- data/lib/flip_the_switch/generator/implementation.m.erb +36 -12
- data/lib/flip_the_switch/generator/plist.rb +19 -1
- data/lib/flip_the_switch/generator/settings.rb +6 -6
- data/lib/flip_the_switch/reader/features.rb +136 -22
- data/spec/flip_the_switch/cli_spec.rb +12 -12
- data/spec/flip_the_switch/environment_spec.rb +20 -0
- data/spec/flip_the_switch/feature_spec.rb +20 -0
- data/spec/flip_the_switch/generator/category_spec.rb +14 -8
- data/spec/flip_the_switch/generator/plist_spec.rb +23 -7
- data/spec/flip_the_switch/generator/settings_spec.rb +6 -3
- data/spec/flip_the_switch/reader/defaults_spec.rb +0 -18
- data/spec/flip_the_switch/reader/features_spec.rb +74 -17
- data/spec/resources/ExpectedFeatures.plist +10 -2
- data/spec/resources/expected_header.h +8 -3
- data/spec/resources/expected_implementation.m +37 -10
- data/spec/resources/invalid_layout/features.json +7 -0
- data/spec/resources/invalid_type/features.json +23 -0
- data/spec/resources/real/features.json +38 -0
- data/tmp/.keep +0 -0
- metadata +74 -16
- data/Classes/FlipTheSwitch/FlipTheSwitch.h +0 -9
- data/Classes/FlipTheSwitch/FlipTheSwitch.m +0 -88
- data/Example/Colors-iOS/Base.lproj/Main_iPhone.storyboard +0 -76
- data/Example/features.yml +0 -3
- data/Tests/Spec/Helpers/GcovTestObserver.h +0 -4
- data/Tests/Spec/Helpers/GcovTestObserver.m +0 -12
- data/spec/resources/invalid_layout/features.yml +0 -4
- data/spec/resources/invalid_type/features.yml +0 -7
- data/spec/resources/real/features.yml +0 -6
@@ -0,0 +1,23 @@
|
|
1
|
+
{
|
2
|
+
"defaults": {
|
3
|
+
"enabled_feature": {
|
4
|
+
"enabled": false,
|
5
|
+
"description": "This feature is enabled",
|
6
|
+
"sub_feature": {
|
7
|
+
"enabled": false
|
8
|
+
}
|
9
|
+
},
|
10
|
+
"disabled_feature_missing_enabled": {
|
11
|
+
}
|
12
|
+
},
|
13
|
+
"beta": {
|
14
|
+
"inherits_from": "defaults",
|
15
|
+
"enabled_feature": {
|
16
|
+
"enabled": true
|
17
|
+
}
|
18
|
+
}
|
19
|
+
}
|
20
|
+
|
21
|
+
|
22
|
+
|
23
|
+
|
@@ -0,0 +1,38 @@
|
|
1
|
+
{
|
2
|
+
"defaults": {
|
3
|
+
"enabled_feature": {
|
4
|
+
"enabled": true,
|
5
|
+
"description": "This feature is enabled",
|
6
|
+
"sub_feature": {
|
7
|
+
"enabled": false,
|
8
|
+
"sub_sub_feature": {
|
9
|
+
"enabled": false
|
10
|
+
}
|
11
|
+
}
|
12
|
+
},
|
13
|
+
"disabled_feature": {
|
14
|
+
"enabled": false
|
15
|
+
}
|
16
|
+
},
|
17
|
+
"alpha": {
|
18
|
+
"inherits_from": "defaults",
|
19
|
+
"enabled_feature": {
|
20
|
+
"enabled": false
|
21
|
+
}
|
22
|
+
},
|
23
|
+
"intermediate": {
|
24
|
+
"inherits_from": "alpha"
|
25
|
+
},
|
26
|
+
"beta": {
|
27
|
+
"inherits_from": "intermediate",
|
28
|
+
"enabled_feature": {
|
29
|
+
"enabled": true,
|
30
|
+
"sub_feature": {
|
31
|
+
"enabled": false,
|
32
|
+
"sub_sub_feature": {
|
33
|
+
"enabled": false
|
34
|
+
}
|
35
|
+
}
|
36
|
+
}
|
37
|
+
}
|
38
|
+
}
|
data/tmp/.keep
ADDED
File without changes
|
metadata
CHANGED
@@ -1,7 +1,7 @@
|
|
1
1
|
--- !ruby/object:Gem::Specification
|
2
2
|
name: flip_the_switch
|
3
3
|
version: !ruby/object:Gem::Version
|
4
|
-
version: 0.
|
4
|
+
version: 1.0.0
|
5
5
|
platform: ruby
|
6
6
|
authors:
|
7
7
|
- Michael England
|
@@ -9,7 +9,7 @@ authors:
|
|
9
9
|
autorequire:
|
10
10
|
bindir: bin
|
11
11
|
cert_chain: []
|
12
|
-
date:
|
12
|
+
date: 2015-10-23 00:00:00.000000000 Z
|
13
13
|
dependencies:
|
14
14
|
- !ruby/object:Gem::Dependency
|
15
15
|
name: activesupport
|
@@ -53,6 +53,20 @@ dependencies:
|
|
53
53
|
- - ~>
|
54
54
|
- !ruby/object:Gem::Version
|
55
55
|
version: '3.1'
|
56
|
+
- !ruby/object:Gem::Dependency
|
57
|
+
name: json-schema
|
58
|
+
requirement: !ruby/object:Gem::Requirement
|
59
|
+
requirements:
|
60
|
+
- - ~>
|
61
|
+
- !ruby/object:Gem::Version
|
62
|
+
version: '2.5'
|
63
|
+
type: :runtime
|
64
|
+
prerelease: false
|
65
|
+
version_requirements: !ruby/object:Gem::Requirement
|
66
|
+
requirements:
|
67
|
+
- - ~>
|
68
|
+
- !ruby/object:Gem::Version
|
69
|
+
version: '2.5'
|
56
70
|
description:
|
57
71
|
email:
|
58
72
|
- mg.england@gmail.com
|
@@ -66,49 +80,88 @@ files:
|
|
66
80
|
- .rspec
|
67
81
|
- .travis.yml
|
68
82
|
- CHANGELOG.md
|
69
|
-
- Classes/FlipTheSwitch/
|
70
|
-
- Classes/FlipTheSwitch/
|
83
|
+
- Classes/FlipTheSwitch/Shared/FTSFeature.h
|
84
|
+
- Classes/FlipTheSwitch/Shared/FTSFeature.m
|
85
|
+
- Classes/FlipTheSwitch/Shared/FTSFlipTheSwitch.h
|
86
|
+
- Classes/FlipTheSwitch/Shared/FTSFlipTheSwitch.m
|
87
|
+
- Classes/FlipTheSwitch/iOS/FTSFeatureCell.h
|
88
|
+
- Classes/FlipTheSwitch/iOS/FTSFeatureCell.m
|
89
|
+
- Classes/FlipTheSwitch/iOS/FTSFeatureConfigurationViewController.h
|
90
|
+
- Classes/FlipTheSwitch/iOS/FTSFeatureConfigurationViewController.m
|
91
|
+
- Classes/FlipTheSwitch/iOS/FTSFeatureDescriptionLabel.h
|
92
|
+
- Classes/FlipTheSwitch/iOS/FTSFeatureDescriptionLabel.m
|
71
93
|
- Example/.gitignore
|
94
|
+
- Example/Colors-OSX/AppDelegate.h
|
95
|
+
- Example/Colors-OSX/AppDelegate.m
|
96
|
+
- Example/Colors-OSX/Base.lproj/Main.storyboard
|
97
|
+
- Example/Colors-OSX/ColoredViews/GreenView.h
|
98
|
+
- Example/Colors-OSX/ColoredViews/GreenView.m
|
99
|
+
- Example/Colors-OSX/ColoredViews/PurpleView.h
|
100
|
+
- Example/Colors-OSX/ColoredViews/PurpleView.m
|
101
|
+
- Example/Colors-OSX/ColoredViews/RedView.h
|
102
|
+
- Example/Colors-OSX/ColoredViews/RedView.m
|
103
|
+
- Example/Colors-OSX/ColoredViews/YellowView.h
|
104
|
+
- Example/Colors-OSX/ColoredViews/YellowView.m
|
105
|
+
- Example/Colors-OSX/FTSFlipTheSwitch+Features.h
|
106
|
+
- Example/Colors-OSX/FTSFlipTheSwitch+Features.m
|
107
|
+
- Example/Colors-OSX/Features.plist
|
108
|
+
- Example/Colors-OSX/Images.xcassets/AppIcon.appiconset/Contents.json
|
109
|
+
- Example/Colors-OSX/Info.plist
|
110
|
+
- Example/Colors-OSX/Settings.bundle/Features.plist
|
111
|
+
- Example/Colors-OSX/Settings.bundle/Root.plist
|
112
|
+
- Example/Colors-OSX/ViewController.h
|
113
|
+
- Example/Colors-OSX/ViewController.m
|
114
|
+
- Example/Colors-OSX/main.m
|
72
115
|
- Example/Colors-iOS/AppDelegateiOS.h
|
73
116
|
- Example/Colors-iOS/AppDelegateiOS.m
|
74
|
-
- Example/Colors-iOS/Base.lproj/
|
117
|
+
- Example/Colors-iOS/Base.lproj/Main.storyboard
|
75
118
|
- Example/Colors-iOS/Colors-iOS-Info.plist
|
76
119
|
- Example/Colors-iOS/Colors-iOS-Prefix.pch
|
120
|
+
- Example/Colors-iOS/FTSFlipTheSwitch+Features.h
|
121
|
+
- Example/Colors-iOS/FTSFlipTheSwitch+Features.m
|
77
122
|
- Example/Colors-iOS/Images.xcassets/AppIcon.appiconset/Contents.json
|
78
123
|
- Example/Colors-iOS/Images.xcassets/LaunchImage.launchimage/Contents.json
|
79
124
|
- Example/Colors-iOS/ViewControlleriOS.h
|
80
125
|
- Example/Colors-iOS/ViewControlleriOS.m
|
81
126
|
- Example/Colors-iOS/main.m
|
82
127
|
- Example/Colors.xcodeproj/project.pbxproj
|
128
|
+
- Example/Colors.xcodeproj/xcshareddata/xcschemes/Colors-OSX.xcscheme
|
83
129
|
- Example/Colors.xcodeproj/xcshareddata/xcschemes/Colors-iOS.xcscheme
|
130
|
+
- Example/FTSFlipTheSwitch+Features.h
|
131
|
+
- Example/FTSFlipTheSwitch+Features.m
|
132
|
+
- Example/Features.plist
|
133
|
+
- Example/Gemfile
|
84
134
|
- Example/Podfile
|
135
|
+
- Example/README.md
|
85
136
|
- Example/Rakefile
|
86
|
-
- Example/features.
|
137
|
+
- Example/features.json
|
87
138
|
- FlipTheSwitch.podspec
|
88
139
|
- Gemfile
|
89
140
|
- Guardfile.example
|
90
141
|
- LICENSE
|
91
142
|
- README.md
|
92
143
|
- Rakefile
|
93
|
-
-
|
144
|
+
- Resources/FlipTheSwitch/FlipTheSwitch.storyboard
|
94
145
|
- Tests/FlipTheSwitchSpec-Mac/FlipTheSwitchSpec-Mac-Info.plist
|
95
146
|
- Tests/FlipTheSwitchSpec-Mac/FlipTheSwitchSpec-Mac-Prefix.pch
|
96
147
|
- Tests/FlipTheSwitchSpec-iOS/Features.plist
|
97
148
|
- Tests/FlipTheSwitchSpec-iOS/FlipTheSwitchSpec-iOS-Info.plist
|
98
149
|
- Tests/FlipTheSwitchSpec-iOS/FlipTheSwitchSpec-iOS-Prefix.pch
|
150
|
+
- Tests/FlipTheSwitchSpec-iOS/OtherFeatures.plist
|
99
151
|
- Tests/FlipTheSwitchSpec.xcodeproj/project.pbxproj
|
100
152
|
- Tests/FlipTheSwitchSpec.xcodeproj/xcshareddata/xcschemes/FlipTheSwitchSpec-Mac.xcscheme
|
101
153
|
- Tests/FlipTheSwitchSpec.xcodeproj/xcshareddata/xcschemes/FlipTheSwitchSpec-iOS.xcscheme
|
102
154
|
- Tests/Podfile
|
103
155
|
- Tests/Rakefile
|
104
156
|
- Tests/Spec/Classes/FlipTheSwitch/FlipTheSwitchSpec.m
|
105
|
-
- Tests/Spec/Helpers/GcovTestObserver.h
|
106
|
-
- Tests/Spec/Helpers/GcovTestObserver.m
|
107
157
|
- bin/flip-the-switch
|
108
158
|
- flip_the_switch.gemspec
|
159
|
+
- images/feature_configuration_screen.png
|
109
160
|
- lib/flip_the_switch.rb
|
110
161
|
- lib/flip_the_switch/cli.rb
|
162
|
+
- lib/flip_the_switch/environment.rb
|
111
163
|
- lib/flip_the_switch/errors.rb
|
164
|
+
- lib/flip_the_switch/feature.rb
|
112
165
|
- lib/flip_the_switch/generator.rb
|
113
166
|
- lib/flip_the_switch/generator/base.rb
|
114
167
|
- lib/flip_the_switch/generator/category.rb
|
@@ -120,6 +173,8 @@ files:
|
|
120
173
|
- lib/flip_the_switch/reader/defaults.rb
|
121
174
|
- lib/flip_the_switch/reader/features.rb
|
122
175
|
- spec/flip_the_switch/cli_spec.rb
|
176
|
+
- spec/flip_the_switch/environment_spec.rb
|
177
|
+
- spec/flip_the_switch/feature_spec.rb
|
123
178
|
- spec/flip_the_switch/generator/category_spec.rb
|
124
179
|
- spec/flip_the_switch/generator/plist_spec.rb
|
125
180
|
- spec/flip_the_switch/generator/settings_spec.rb
|
@@ -132,10 +187,11 @@ files:
|
|
132
187
|
- spec/resources/ExpectedSettingsMergeExistingRoot.plist
|
133
188
|
- spec/resources/expected_header.h
|
134
189
|
- spec/resources/expected_implementation.m
|
135
|
-
- spec/resources/invalid_layout/features.
|
136
|
-
- spec/resources/invalid_type/features.
|
137
|
-
- spec/resources/real/features.
|
190
|
+
- spec/resources/invalid_layout/features.json
|
191
|
+
- spec/resources/invalid_type/features.json
|
192
|
+
- spec/resources/real/features.json
|
138
193
|
- spec/spec_helper.rb
|
194
|
+
- tmp/.keep
|
139
195
|
homepage: https://github.com/michaelengland/FlipTheSwitch
|
140
196
|
licenses:
|
141
197
|
- MIT
|
@@ -156,12 +212,14 @@ required_rubygems_version: !ruby/object:Gem::Requirement
|
|
156
212
|
version: '0'
|
157
213
|
requirements: []
|
158
214
|
rubyforge_project:
|
159
|
-
rubygems_version: 2.
|
215
|
+
rubygems_version: 2.4.5
|
160
216
|
signing_key:
|
161
217
|
specification_version: 4
|
162
218
|
summary: A simple library to help enabling/disabling features on iOS/Mac applications.
|
163
219
|
test_files:
|
164
220
|
- spec/flip_the_switch/cli_spec.rb
|
221
|
+
- spec/flip_the_switch/environment_spec.rb
|
222
|
+
- spec/flip_the_switch/feature_spec.rb
|
165
223
|
- spec/flip_the_switch/generator/category_spec.rb
|
166
224
|
- spec/flip_the_switch/generator/plist_spec.rb
|
167
225
|
- spec/flip_the_switch/generator/settings_spec.rb
|
@@ -174,7 +232,7 @@ test_files:
|
|
174
232
|
- spec/resources/ExpectedSettingsMergeExistingRoot.plist
|
175
233
|
- spec/resources/expected_header.h
|
176
234
|
- spec/resources/expected_implementation.m
|
177
|
-
- spec/resources/invalid_layout/features.
|
178
|
-
- spec/resources/invalid_type/features.
|
179
|
-
- spec/resources/real/features.
|
235
|
+
- spec/resources/invalid_layout/features.json
|
236
|
+
- spec/resources/invalid_type/features.json
|
237
|
+
- spec/resources/real/features.json
|
180
238
|
- spec/spec_helper.rb
|
@@ -1,9 +0,0 @@
|
|
1
|
-
@interface FlipTheSwitch : NSObject
|
2
|
-
- (instancetype)init __attribute__((unavailable("init not available ")));
|
3
|
-
+ (instancetype)sharedInstance;
|
4
|
-
|
5
|
-
- (BOOL)isFeatureEnabled:(NSString *)feature;
|
6
|
-
- (void)enableFeature:(NSString *)feature;
|
7
|
-
- (void)disableFeature:(NSString *)feature;
|
8
|
-
- (void)setFeature:(NSString *)feature enabled:(BOOL)enabled;
|
9
|
-
@end
|
@@ -1,88 +0,0 @@
|
|
1
|
-
#import "FlipTheSwitch.h"
|
2
|
-
|
3
|
-
@interface FlipTheSwitch ()
|
4
|
-
@property (nonatomic, readonly) NSUserDefaults *userDefaults;
|
5
|
-
@property (nonatomic, readonly) NSBundle *bundle;
|
6
|
-
@end
|
7
|
-
|
8
|
-
@implementation FlipTheSwitch {
|
9
|
-
NSDictionary *_plistEnabledFeatures;
|
10
|
-
}
|
11
|
-
|
12
|
-
#pragma mark - Singleton
|
13
|
-
|
14
|
-
+ (instancetype)sharedInstance
|
15
|
-
{
|
16
|
-
static FlipTheSwitch *sharedInstance;
|
17
|
-
static dispatch_once_t once;
|
18
|
-
dispatch_once(&once, ^{
|
19
|
-
sharedInstance = [[self alloc] initWithUserDefaults:[NSUserDefaults standardUserDefaults]
|
20
|
-
bundle:[NSBundle mainBundle]];
|
21
|
-
});
|
22
|
-
return sharedInstance;
|
23
|
-
}
|
24
|
-
|
25
|
-
#pragma mark - Initialization
|
26
|
-
|
27
|
-
- (instancetype)initWithUserDefaults:(NSUserDefaults *)userDefaults
|
28
|
-
bundle:(NSBundle *)bundle
|
29
|
-
{
|
30
|
-
self = [super init];
|
31
|
-
if (self) {
|
32
|
-
NSParameterAssert(userDefaults);
|
33
|
-
NSParameterAssert(bundle);
|
34
|
-
_userDefaults = userDefaults;
|
35
|
-
_bundle = bundle;
|
36
|
-
}
|
37
|
-
return self;
|
38
|
-
}
|
39
|
-
|
40
|
-
#pragma mark - Public
|
41
|
-
|
42
|
-
- (BOOL)isFeatureEnabled:(NSString *)feature
|
43
|
-
{
|
44
|
-
NSNumber *userEnabledFeature = [self.userDefaults objectForKey:[self userKeyForFeature:feature]];
|
45
|
-
if (userEnabledFeature) {
|
46
|
-
return [userEnabledFeature boolValue];
|
47
|
-
} else {
|
48
|
-
return [[[self plistEnabledFeatures] objectForKey:feature] boolValue];
|
49
|
-
}
|
50
|
-
}
|
51
|
-
|
52
|
-
- (void)enableFeature:(NSString *)feature
|
53
|
-
{
|
54
|
-
[self setFeature:feature enabled:YES];
|
55
|
-
}
|
56
|
-
|
57
|
-
- (void)disableFeature:(NSString *)feature
|
58
|
-
{
|
59
|
-
[self setFeature:feature enabled:NO];
|
60
|
-
}
|
61
|
-
|
62
|
-
- (void)setFeature:(NSString *)feature enabled:(BOOL)enabled
|
63
|
-
{
|
64
|
-
[self.userDefaults setBool:enabled forKey:[self userKeyForFeature:feature]];
|
65
|
-
[self.userDefaults synchronize];
|
66
|
-
}
|
67
|
-
|
68
|
-
#pragma mark - Private
|
69
|
-
|
70
|
-
- (NSString *)userKeyForFeature:(NSString *)feature
|
71
|
-
{
|
72
|
-
return [NSString stringWithFormat:@"FTS_FEATURE_%@", feature];
|
73
|
-
}
|
74
|
-
|
75
|
-
- (NSDictionary *)plistEnabledFeatures
|
76
|
-
{
|
77
|
-
if (!_plistEnabledFeatures) {
|
78
|
-
_plistEnabledFeatures = [[NSDictionary alloc] initWithContentsOfFile:[self featurePlistPath]];
|
79
|
-
}
|
80
|
-
return _plistEnabledFeatures;
|
81
|
-
}
|
82
|
-
|
83
|
-
- (NSString *)featurePlistPath
|
84
|
-
{
|
85
|
-
return [self.bundle pathForResource:@"Features" ofType:@"plist"];
|
86
|
-
}
|
87
|
-
|
88
|
-
@end
|
@@ -1,76 +0,0 @@
|
|
1
|
-
<?xml version="1.0" encoding="UTF-8" standalone="no"?>
|
2
|
-
<document type="com.apple.InterfaceBuilder3.CocoaTouch.Storyboard.XIB" version="3.0" toolsVersion="5056" systemVersion="12F45" targetRuntime="iOS.CocoaTouch" propertyAccessControl="none" useAutolayout="YES" initialViewController="vXZ-lx-hvc">
|
3
|
-
<dependencies>
|
4
|
-
<plugIn identifier="com.apple.InterfaceBuilder.IBCocoaTouchPlugin" version="3733"/>
|
5
|
-
</dependencies>
|
6
|
-
<scenes>
|
7
|
-
<!--View ControlleriOS-->
|
8
|
-
<scene sceneID="ufC-wZ-h7g">
|
9
|
-
<objects>
|
10
|
-
<viewController id="vXZ-lx-hvc" customClass="ViewControlleriOS" sceneMemberID="viewController">
|
11
|
-
<layoutGuides>
|
12
|
-
<viewControllerLayoutGuide type="top" id="jyV-Pf-zRb"/>
|
13
|
-
<viewControllerLayoutGuide type="bottom" id="2fi-mo-0CV"/>
|
14
|
-
</layoutGuides>
|
15
|
-
<view key="view" contentMode="scaleToFill" id="kh9-bI-dsS">
|
16
|
-
<rect key="frame" x="0.0" y="0.0" width="320" height="568"/>
|
17
|
-
<autoresizingMask key="autoresizingMask" flexibleMaxX="YES" flexibleMaxY="YES"/>
|
18
|
-
<subviews>
|
19
|
-
<view contentMode="scaleToFill" fixedFrame="YES" translatesAutoresizingMaskIntoConstraints="NO" id="n3c-1r-4pm">
|
20
|
-
<rect key="frame" x="0.0" y="0.0" width="320" height="259"/>
|
21
|
-
<autoresizingMask key="autoresizingMask" flexibleMaxX="YES" flexibleMaxY="YES"/>
|
22
|
-
<subviews>
|
23
|
-
<button opaque="NO" contentMode="scaleToFill" fixedFrame="YES" contentHorizontalAlignment="center" contentVerticalAlignment="center" buttonType="roundedRect" lineBreakMode="middleTruncation" translatesAutoresizingMaskIntoConstraints="NO" id="hmn-zk-CNu">
|
24
|
-
<rect key="frame" x="88" y="161" width="145" height="30"/>
|
25
|
-
<autoresizingMask key="autoresizingMask" flexibleMaxX="YES" flexibleMaxY="YES"/>
|
26
|
-
<state key="normal" title="Change the top color">
|
27
|
-
<color key="titleShadowColor" white="0.5" alpha="1" colorSpace="calibratedWhite"/>
|
28
|
-
</state>
|
29
|
-
<connections>
|
30
|
-
<action selector="topColorChangeButtonTapped" destination="vXZ-lx-hvc" eventType="touchUpInside" id="UDv-XR-9Cr"/>
|
31
|
-
</connections>
|
32
|
-
</button>
|
33
|
-
<label opaque="NO" clipsSubviews="YES" userInteractionEnabled="NO" contentMode="left" horizontalHuggingPriority="251" verticalHuggingPriority="251" fixedFrame="YES" text="The top part of the screen is green" textAlignment="center" lineBreakMode="tailTruncation" baselineAdjustment="alignBaselines" adjustsFontSizeToFit="NO" translatesAutoresizingMaskIntoConstraints="NO" id="6sQ-se-sag">
|
34
|
-
<rect key="frame" x="0.0" y="119" width="320" height="21"/>
|
35
|
-
<autoresizingMask key="autoresizingMask" flexibleMaxX="YES" flexibleMaxY="YES"/>
|
36
|
-
<fontDescription key="fontDescription" type="system" pointSize="17"/>
|
37
|
-
<color key="textColor" cocoaTouchSystemColor="darkTextColor"/>
|
38
|
-
<nil key="highlightedColor"/>
|
39
|
-
</label>
|
40
|
-
</subviews>
|
41
|
-
<color key="backgroundColor" red="0.0" green="1" blue="0.0" alpha="1" colorSpace="calibratedRGB"/>
|
42
|
-
</view>
|
43
|
-
<view contentMode="scaleToFill" fixedFrame="YES" translatesAutoresizingMaskIntoConstraints="NO" id="7pg-AU-squ">
|
44
|
-
<rect key="frame" x="0.0" y="267" width="320" height="301"/>
|
45
|
-
<autoresizingMask key="autoresizingMask" flexibleMaxX="YES" flexibleMaxY="YES"/>
|
46
|
-
<subviews>
|
47
|
-
<label opaque="NO" clipsSubviews="YES" userInteractionEnabled="NO" contentMode="left" horizontalHuggingPriority="251" verticalHuggingPriority="251" fixedFrame="YES" text="The bottom part of the screen is yellow" textAlignment="center" lineBreakMode="tailTruncation" baselineAdjustment="alignBaselines" adjustsFontSizeToFit="NO" translatesAutoresizingMaskIntoConstraints="NO" id="l8T-13-b9l">
|
48
|
-
<rect key="frame" x="0.0" y="140" width="320" height="21"/>
|
49
|
-
<autoresizingMask key="autoresizingMask" flexibleMaxX="YES" flexibleMaxY="YES"/>
|
50
|
-
<fontDescription key="fontDescription" type="system" pointSize="17"/>
|
51
|
-
<color key="textColor" cocoaTouchSystemColor="darkTextColor"/>
|
52
|
-
<nil key="highlightedColor"/>
|
53
|
-
</label>
|
54
|
-
</subviews>
|
55
|
-
<color key="backgroundColor" red="1" green="1" blue="0.0" alpha="1" colorSpace="calibratedRGB"/>
|
56
|
-
</view>
|
57
|
-
</subviews>
|
58
|
-
</view>
|
59
|
-
<connections>
|
60
|
-
<outlet property="bottomColorInfoTextView" destination="l8T-13-b9l" id="DVQ-Pv-h5e"/>
|
61
|
-
<outlet property="bottomColorView" destination="7pg-AU-squ" id="V4I-KX-4e3"/>
|
62
|
-
<outlet property="topColorChangeButton" destination="hmn-zk-CNu" id="u6i-up-Bry"/>
|
63
|
-
<outlet property="topColorInfoTextView" destination="6sQ-se-sag" id="ury-Jl-zil"/>
|
64
|
-
<outlet property="topColorView" destination="n3c-1r-4pm" id="zTf-UX-aoz"/>
|
65
|
-
</connections>
|
66
|
-
</viewController>
|
67
|
-
<placeholder placeholderIdentifier="IBFirstResponder" id="x5A-6p-PRh" sceneMemberID="firstResponder"/>
|
68
|
-
</objects>
|
69
|
-
</scene>
|
70
|
-
</scenes>
|
71
|
-
<simulatedMetricsContainer key="defaultSimulatedMetrics">
|
72
|
-
<simulatedStatusBarMetrics key="statusBar"/>
|
73
|
-
<simulatedOrientationMetrics key="orientation"/>
|
74
|
-
<simulatedScreenMetrics key="destination" type="retina4"/>
|
75
|
-
</simulatedMetricsContainer>
|
76
|
-
</document>
|
data/Example/features.yml
DELETED