File tree Expand file tree Collapse file tree 2 files changed +14
-0
lines changed
Expand file tree Collapse file tree 2 files changed +14
-0
lines changed Original file line number Diff line number Diff line change @@ -37,6 +37,10 @@ extern NSErrorDomain const TPSBuildSettingExtractorErrorDomain;
3737// Returns NO if all the values in a dictionary are an empty string
3838// Raises an exception if used on a dictionary with any non-NSString value
3939- (BOOL )containsBuildSettings ;
40+
41+ // Returns a new dictionary containing all entries in the receiver except for
42+ // entries with an empty string value.
43+ - (NSDictionary *)tps_dictionaryByRemovingEmptyStringValues ;
4044@end
4145
4246#pragma mark -
Original file line number Diff line number Diff line change @@ -71,6 +71,16 @@ - (BOOL)containsBuildSettings {
7171 return foundNonEmptyString;
7272 }
7373
74+ - (NSDictionary *)tps_dictionaryByRemovingEmptyStringValues {
75+ NSMutableDictionary *temp = [[NSMutableDictionary alloc ] init ];
76+ [self enumerateKeysAndObjectsUsingBlock: ^(id _Nonnull key, id _Nonnull value, BOOL * _Nonnull stop) {
77+ if (![value isEqualTo: @" " ]) {
78+ [temp setValue: value forKey: key];
79+ }
80+ }];
81+ return temp;
82+ }
83+
7484@end
7585
7686#pragma mark -
You can’t perform that action at this time.
0 commit comments