Skip to content

Commit 428ad1d

Browse files
Fix an issue where importing an Objective-C type called Optional causes LLDB to sometimes not be able to distinguish between Swift.Optional and OptimizelySDKiOS.Optional. (#274)
1 parent f421f49 commit 428ad1d

25 files changed

+64
-64
lines changed

OptimizelySDKCore/OPTLYJSONModel/OPTLYJSONModel/OPTLYJSONModel/OPTLYJSONModel.h

Lines changed: 6 additions & 6 deletions
Original file line numberDiff line numberDiff line change
@@ -57,16 +57,16 @@ DEPRECATED_ATTRIBUTE
5757
* Protocol for defining optional properties in a JSON Model class. Use like below to define
5858
* model properties that are not required to have values in the JSON input:
5959
*
60-
* @property (strong, nonatomic) NSString<Optional> *propertyName;
60+
* @property (strong, nonatomic) NSString<OPTLYOptional> *propertyName;
6161
*
6262
*/
63-
@protocol Optional
63+
@protocol OPTLYOptional
6464
@end
6565

6666
/**
6767
* Make all objects compatible to avoid compiler warnings
6868
*/
69-
@interface NSObject (OPTLYJSONModelPropertyCompatibility) <Optional, Ignore>
69+
@interface NSObject (OPTLYJSONModelPropertyCompatibility) <OPTLYOptional, Ignore>
7070
@end
7171

7272
/////////////////////////////////////////////////////////////////////////////////////////////
@@ -250,11 +250,11 @@ DEPRECATED_ATTRIBUTE
250250
+ (OPTLYJSONKeyMapper *)keyMapper;
251251

252252
/**
253-
* Indicates whether the property with the given name is Optional.
254-
* To have a model with all of its properties being Optional just return YES.
253+
* Indicates whether the property with the given name is OPTLYOptional.
254+
* To have a model with all of its properties being OPTLYOptional just return YES.
255255
* This method returns by default NO, since the default behaviour is to have all properties required.
256256
* @param propertyName the name of the property
257-
* @return a BOOL result indicating whether the property is optional
257+
* @return a BOOL result indicating whether the property is OPTLYOptional
258258
*/
259259
+ (BOOL)propertyIsOptional:(NSString *)propertyName;
260260

OptimizelySDKCore/OPTLYJSONModel/OPTLYJSONModel/OPTLYJSONModel/OPTLYJSONModel.m

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -607,7 +607,7 @@ -(void)__inspectProperties
607607

608608
[scanner scanUpToString:@">" intoString: &protocolName];
609609

610-
if ([protocolName isEqualToString:@"Optional"]) {
610+
if ([protocolName isEqualToString:@"OPTLYOptional"]) {
611611
p.isOptional = YES;
612612
} else if([protocolName isEqualToString:@"Index"]) {
613613
#pragma GCC diagnostic push

OptimizelySDKCore/OPTLYJSONModel/README.md

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -211,9 +211,9 @@ for OPTLYJSONModel to work, the protocol must be in place.
211211
```objc
212212
@interface ProductModel : OPTLYJSONModel
213213
@property (nonatomic) NSInteger id;
214-
@property (nonatomic) NSString <Optional> *name;
214+
@property (nonatomic) NSString <OPTLYOptional> *name;
215215
@property (nonatomic) float price;
216-
@property (nonatomic) NSNumber <Optional> *uuid;
216+
@property (nonatomic) NSNumber <OPTLYOptional> *uuid;
217217
@end
218218
```
219219

OptimizelySDKCore/OPTLYJSONModelTests/KeyMappingTests.m

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -39,9 +39,9 @@
3939
@interface TestModel: OPTLYJSONModel
4040

4141
@property (strong, nonatomic) NSString* text1;
42-
@property (strong, nonatomic) NSString<Optional>* text2;
42+
@property (strong, nonatomic) NSString<OPTLYOptional>* text2;
4343

44-
@property (strong, nonatomic) NSString<Optional>* text3;
44+
@property (strong, nonatomic) NSString<OPTLYOptional>* text3;
4545

4646
@end
4747

OptimizelySDKCore/OPTLYJSONModelTests/Models/Headers/ConcurrentReposModel.h

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -32,7 +32,7 @@
3232
@property (assign, nonatomic) int watchers;
3333
@property (strong, nonatomic) NSString* owner;
3434
@property (assign, nonatomic) int forks;
35-
@property (strong, nonatomic) NSString<Optional>* language;
35+
@property (strong, nonatomic) NSString<OPTLYOptional>* language;
3636
@property (assign, nonatomic) BOOL fork;
3737
@property (assign, nonatomic) double size;
3838
@property (assign, nonatomic) int followers;

OptimizelySDKCore/OPTLYJSONModelTests/Models/Headers/GitHubKeyMapRepoModel.h

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -27,7 +27,7 @@
2727
@interface GitHubKeyMapRepoModel : OPTLYJSONModel
2828

2929
@property (strong, nonatomic) NSString* __description;
30-
@property (strong, nonatomic) NSString<Optional>* language;
30+
@property (strong, nonatomic) NSString<OPTLYOptional>* language;
3131

3232
#pragma GCC diagnostic push
3333
#pragma GCC diagnostic ignored "-Wdeprecated-declarations"

OptimizelySDKCore/OPTLYJSONModelTests/Models/Headers/GitHubRepoModel.h

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -31,7 +31,7 @@
3131
@property (assign, nonatomic) int watchers;
3232
@property (strong, nonatomic) NSString* owner;
3333
@property (assign, nonatomic) int forks;
34-
@property (strong, nonatomic) NSString<Optional>* language;
34+
@property (strong, nonatomic) NSString<OPTLYOptional>* language;
3535
@property (assign, nonatomic) BOOL fork;
3636
@property (assign, nonatomic) double size;
3737
@property (assign, nonatomic) int followers;

OptimizelySDKCore/OPTLYJSONModelTests/Models/Headers/GitHubRepoModelForUSMapper.h

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -30,6 +30,6 @@
3030
@property (strong, nonatomic) NSDate* createdAt;
3131
@property (assign, nonatomic) int aVeryLongPropertyName;
3232
@property (strong, nonatomic) NSString* itemObject145;
33-
@property (strong, nonatomic) NSString<Optional>* itemObject176Details;
33+
@property (strong, nonatomic) NSString<OPTLYOptional>* itemObject176Details;
3434

3535
@end

OptimizelySDKCore/OPTLYJSONModelTests/Models/Headers/ImageModel.h

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -30,6 +30,6 @@
3030

3131
@property (strong, nonatomic) NSNumber* idImage;
3232
@property (strong, nonatomic) NSString* name;
33-
@property (strong, nonatomic) CopyrightModel<Optional>* copyright;
33+
@property (strong, nonatomic) CopyrightModel<OPTLYOptional>* copyright;
3434

3535
@end

OptimizelySDKCore/OPTLYJSONModelTests/Models/Headers/JSONTypesModel.h

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -34,6 +34,6 @@
3434
@property (strong, nonatomic) NSMutableArray* dynamicList;
3535
@property (strong, nonatomic) NSDictionary* dictionary;
3636
@property (strong, nonatomic) NSMutableDictionary* dynamicDictionary;
37-
@property (strong, nonatomic) NSString<Optional>* notAvailable;
37+
@property (strong, nonatomic) NSString<OPTLYOptional>* notAvailable;
3838

3939
@end

0 commit comments

Comments
 (0)