This repository was archived by the owner on Apr 5, 2023. It is now read-only.
File tree Expand file tree Collapse file tree 1 file changed +6
-1
lines changed
OptimizelySDKCore/OptimizelySDKCore Expand file tree Collapse file tree 1 file changed +6
-1
lines changed Original file line number Diff line number Diff line change @@ -41,8 +41,12 @@ + (OPTLYJSONKeyMapper*)keyMapper
41
41
}
42
42
43
43
- (void )setAudienceConditionsWithNSString : (NSString *)string {
44
- NSError *err = nil ;
45
44
NSArray *array = [string getValidAudienceConditionsArray ];
45
+ [self setAudienceConditionsWithNSArray: array];
46
+ }
47
+
48
+ - (void )setAudienceConditionsWithNSArray : (NSArray *)array {
49
+ NSError *err = nil ;
46
50
self.audienceConditions = [OPTLYCondition deserializeAudienceConditionsJSONArray: array error: &err];
47
51
48
52
if (err != nil ) {
@@ -52,6 +56,7 @@ - (void)setAudienceConditionsWithNSString:(NSString *)string {
52
56
}
53
57
54
58
- (nullable NSNumber *)evaluateConditionsWithAttributes : (NSDictionary <NSString *, NSObject *> *)attributes projectConfig : (nullable OPTLYProjectConfig *)config {
59
+
55
60
for (NSObject <OPTLYCondition> *condition in self.audienceConditions ) {
56
61
NSNumber *result = [condition evaluateConditionsWithAttributes: attributes projectConfig: config];
57
62
if (result != NULL && [result boolValue ] == true ) {
You can’t perform that action at this time.
0 commit comments