Skip to content

Commit d41bf81

Browse files
jaeoptthomaszurkan-optimizely
authored andcommitted
(fix): rename protocols in OPTLYJSONModel to avoid conflicts with JSONModel in client apps (#431)
* fix name conflicts of OPTLYJSONModel protocols * cleanup
1 parent 98f640f commit d41bf81

File tree

15 files changed

+40
-44
lines changed

15 files changed

+40
-44
lines changed

OptimizelySDKCore/OPTLYJSONModel/OPTLYJSONModel/OPTLYJSONModel/OPTLYJSONModel.h

Lines changed: 3 additions & 7 deletions
Original file line numberDiff line numberDiff line change
@@ -35,11 +35,7 @@ lastPathComponent], __LINE__, [NSString stringWithFormat:(s), ##__VA_ARGS__] )
3535
/////////////////////////////////////////////////////////////////////////////////////////////
3636

3737
DEPRECATED_ATTRIBUTE
38-
@protocol ConvertOnDemand
39-
@end
40-
41-
DEPRECATED_ATTRIBUTE
42-
@protocol Index
38+
@protocol OPTLYIndex
4339
@end
4440

4541
#pragma mark - Property Protocols
@@ -50,7 +46,7 @@ DEPRECATED_ATTRIBUTE
5046
* @property (strong, nonatomic) NSString<Ignore> *propertyName;
5147
*
5248
*/
53-
@protocol Ignore
49+
@protocol OPTLYIgnore
5450
@end
5551

5652
/**
@@ -66,7 +62,7 @@ DEPRECATED_ATTRIBUTE
6662
/**
6763
* Make all objects compatible to avoid compiler warnings
6864
*/
69-
@interface NSObject (OPTLYJSONModelPropertyCompatibility) <OPTLYOptional, Ignore>
65+
@interface NSObject (OPTLYJSONModelPropertyCompatibility) <OPTLYOptional, OPTLYIgnore>
7066
@end
7167

7268
/////////////////////////////////////////////////////////////////////////////////////////////

OptimizelySDKCore/OPTLYJSONModel/OPTLYJSONModel/OPTLYJSONModel/OPTLYJSONModel.m

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -609,7 +609,7 @@ -(void)__inspectProperties
609609

610610
if ([protocolName isEqualToString:@"OPTLYOptional"]) {
611611
p.isOptional = YES;
612-
} else if([protocolName isEqualToString:@"Index"]) {
612+
} else if([protocolName isEqualToString:@"OPTLYIndex"]) {
613613
#pragma GCC diagnostic push
614614
#pragma GCC diagnostic ignored "-Wdeprecated-declarations"
615615
p.isIndex = YES;
@@ -621,7 +621,7 @@ -(void)__inspectProperties
621621
p.name,
622622
OBJC_ASSOCIATION_RETAIN // This is atomic
623623
);
624-
} else if([protocolName isEqualToString:@"Ignore"]) {
624+
} else if([protocolName isEqualToString:@"OPTLYIgnore"]) {
625625
p = nil;
626626
} else {
627627
p.protocol = protocolName;

OptimizelySDKCore/OPTLYJSONModelTests/Models/Headers/ConcurrentReposModel.h

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -39,7 +39,7 @@
3939

4040
#pragma GCC diagnostic push
4141
#pragma GCC diagnostic ignored "-Wdeprecated-declarations"
42-
@property (strong, nonatomic) NSString<Index>* name;
42+
@property (strong, nonatomic) NSString<OPTLYIndex>* name;
4343
#pragma GCC diagnostic pop
4444

4545
@end

OptimizelySDKCore/OPTLYJSONModelTests/Models/Headers/GitHubKeyMapRepoModel.h

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -31,7 +31,7 @@
3131

3232
#pragma GCC diagnostic push
3333
#pragma GCC diagnostic ignored "-Wdeprecated-declarations"
34-
@property (assign, nonatomic) NSString<Index>* name;
34+
@property (assign, nonatomic) NSString<OPTLYIndex>* name;
3535
#pragma GCC diagnostic pop
3636

3737
@end

OptimizelySDKCore/OPTLYJSONModelTests/Models/Headers/GitHubRepoModel.h

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -38,7 +38,7 @@
3838

3939
#pragma GCC diagnostic push
4040
#pragma GCC diagnostic ignored "-Wdeprecated-declarations"
41-
@property (strong, nonatomic) NSString<Index>* name;
41+
@property (strong, nonatomic) NSString<OPTLYIndex>* name;
4242
#pragma GCC diagnostic pop
4343

4444
@end

OptimizelySDKCore/OPTLYJSONModelTests/Models/Headers/OptionalPropModel.h

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -29,7 +29,7 @@
2929

3030
@property (assign, nonatomic) int fillerNumber;
3131
@property (strong, nonatomic) NSString<OPTLYOptional>* notRequredProperty;
32-
@property (strong, nonatomic) NSString<Ignore>* ignoredProperty;
32+
@property (strong, nonatomic) NSString<OPTLYIgnore>* ignoredProperty;
3333
@property (assign, nonatomic) CGPoint notRequiredPoint;
3434

3535
+(BOOL)propertyIsOptional:(NSString*)propertyName;

OptimizelySDKCore/OPTLYJSONModelTests/Models/Headers/PostModel.h

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -28,7 +28,7 @@
2828

2929
#pragma GCC diagnostic push
3030
#pragma GCC diagnostic ignored "-Wdeprecated-declarations"
31-
@property (strong, nonatomic) NSString<Index>* id;
31+
@property (strong, nonatomic) NSString<OPTLYIndex>* id;
3232
#pragma GCC diagnostic pop
3333

3434
@property (strong, nonatomic) NSString<OPTLYOptional>* name;

OptimizelySDKCore/OptimizelySDKCore/OPTLYAudience.m

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -23,7 +23,7 @@
2323

2424
@interface OPTLYAudience()
2525
/// String representation of the conditions
26-
@property (nonatomic, strong) NSString<Ignore> *conditionsString;
26+
@property (nonatomic, strong) NSString<OPTLYIgnore> *conditionsString;
2727
@end
2828

2929
@implementation OPTLYAudience

OptimizelySDKCore/OptimizelySDKCore/OPTLYBaseCondition.m

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -22,7 +22,7 @@
2222

2323
@interface OPTLYBaseCondition()
2424
/// String representation of self
25-
@property (nonatomic, strong) NSString<Ignore> *stringRepresentation;
25+
@property (nonatomic, strong) NSString<OPTLYIgnore> *stringRepresentation;
2626
@end
2727

2828
@implementation OPTLYBaseCondition

OptimizelySDKCore/OptimizelySDKCore/OPTLYExperiment.h

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -45,7 +45,7 @@ NS_ASSUME_NONNULL_END
4545
/// The experiment's status.
4646
@property (nonatomic, strong, nonnull) NSString *status;
4747
/// The group ID the experiment belongs to.
48-
@property (nonatomic, strong, nullable) NSString<Ignore> *groupId;
48+
@property (nonatomic, strong, nullable) NSString<OPTLYIgnore> *groupId;
4949
/// The experiment's traffic allocations.
5050
@property (nonatomic, strong, nonnull) NSArray<OPTLYTrafficAllocation *><OPTLYTrafficAllocation> *trafficAllocations;
5151
/// An array of audience Ids for the experiment

0 commit comments

Comments
 (0)