Skip to content

Commit

Permalink
Merge pull request #29 from velocidi/make-json-model-compatible-with-…
Browse files Browse the repository at this point in the history
…swift-3

Make JSONModel usage compatible with Swift 3
  • Loading branch information
beatriz authored Aug 14, 2020
2 parents 7bc8c80 + b21b385 commit eb865c6
Show file tree
Hide file tree
Showing 11 changed files with 75 additions and 0 deletions.
7 changes: 7 additions & 0 deletions VelocidiSDK/VelocidiSDK/Tracking/Model/VSDKAddToCart.m
Original file line number Diff line number Diff line change
@@ -1,4 +1,5 @@
#import "VSDKAddToCart.h"
#import "VSDKProduct.h"

@implementation VSDKAddToCart

Expand All @@ -9,4 +10,10 @@ - (instancetype)init {
return self;
}

+ (Class)classForCollectionProperty:(NSString *)propertyName {
if ([propertyName isEqualToString:@"products"])
return [VSDKProduct class];
return nil;
}

@end
6 changes: 6 additions & 0 deletions VelocidiSDK/VelocidiSDK/Tracking/Model/VSDKOrder.m
Original file line number Diff line number Diff line change
Expand Up @@ -2,4 +2,10 @@

@implementation VSDKOrder

+ (Class)classForCollectionProperty:(NSString *)propertyName {
if ([propertyName isEqualToString:@"promotions"])
return [NSString class];
return nil;
}

@end
7 changes: 7 additions & 0 deletions VelocidiSDK/VelocidiSDK/Tracking/Model/VSDKOrderPlace.m
Original file line number Diff line number Diff line change
@@ -1,3 +1,4 @@
#import "VSDKLineItem.h"
#import "VSDKOrderPlace.h"

@implementation VSDKOrderPlace
Expand All @@ -9,4 +10,10 @@ - (instancetype) init {
return self;
}

+ (Class)classForCollectionProperty:(NSString *)propertyName {
if ([propertyName isEqualToString:@"lineItems"])
return [VSDKLineItem class];
return nil;
}

@end
6 changes: 6 additions & 0 deletions VelocidiSDK/VelocidiSDK/Tracking/Model/VSDKProduct.m
Original file line number Diff line number Diff line change
Expand Up @@ -9,4 +9,10 @@ - (instancetype)init {
return self;
}

+ (Class)classForCollectionProperty:(NSString *)propertyName {
if ([propertyName isEqualToString:@"parts"])
return [VSDKProduct class];
return nil;
}

@end
7 changes: 7 additions & 0 deletions VelocidiSDK/VelocidiSDK/Tracking/Model/VSDKProductClick.m
Original file line number Diff line number Diff line change
@@ -1,3 +1,4 @@
#import "VSDKProduct.h"
#import "VSDKProductClick.h"

@implementation VSDKProductClick
Expand All @@ -9,4 +10,10 @@ - (instancetype)init {
return self;
}

+ (Class)classForCollectionProperty:(NSString *)propertyName {
if ([propertyName isEqualToString:@"products"])
return [VSDKProduct class];
return nil;
}

@end
Original file line number Diff line number Diff line change
@@ -1,3 +1,4 @@
#import "VSDKProduct.h"
#import "VSDKProductCustomization.h"

@implementation VSDKProductCustomization
Expand All @@ -9,4 +10,10 @@ - (instancetype)init {
return self;
}

+ (Class)classForCollectionProperty:(NSString *)propertyName {
if ([propertyName isEqualToString:@"products"])
return [VSDKProduct class];
return nil;
}

@end
7 changes: 7 additions & 0 deletions VelocidiSDK/VelocidiSDK/Tracking/Model/VSDKProductFeedback.m
Original file line number Diff line number Diff line change
@@ -1,3 +1,4 @@
#import "VSDKProduct.h"
#import "VSDKProductFeedback.h"

@implementation VSDKProductFeedback
Expand All @@ -9,4 +10,10 @@ - (instancetype)init {
return self;
}

+ (Class)classForCollectionProperty:(NSString *)propertyName {
if ([propertyName isEqualToString:@"products"])
return [VSDKProduct class];
return nil;
}

@end
Original file line number Diff line number Diff line change
@@ -1,3 +1,4 @@
#import "VSDKProduct.h"
#import "VSDKProductImpression.h"

@implementation VSDKProductImpression
Expand All @@ -9,4 +10,10 @@ - (instancetype)init {
return self;
}

+ (Class)classForCollectionProperty:(NSString *)propertyName {
if ([propertyName isEqualToString:@"products"])
return [VSDKProduct class];
return nil;
}

@end
7 changes: 7 additions & 0 deletions VelocidiSDK/VelocidiSDK/Tracking/Model/VSDKProductView.m
Original file line number Diff line number Diff line change
@@ -1,3 +1,4 @@
#import "VSDKProduct.h"
#import "VSDKProductView.h"

@implementation VSDKProductView
Expand All @@ -9,4 +10,10 @@ - (instancetype)init {
return self;
}

+ (Class)classForCollectionProperty:(NSString *)propertyName {
if ([propertyName isEqualToString:@"products"])
return [VSDKProduct class];
return nil;
}

@end
Original file line number Diff line number Diff line change
@@ -1,3 +1,4 @@
#import "VSDKProduct.h"
#import "VSDKProductViewDetails.h"

@implementation VSDKProductViewDetails
Expand All @@ -9,4 +10,10 @@ - (instancetype)init {
return self;
}

+ (Class)classForCollectionProperty:(NSString *)propertyName {
if ([propertyName isEqualToString:@"products"])
return [VSDKProduct class];
return nil;
}

@end
7 changes: 7 additions & 0 deletions VelocidiSDK/VelocidiSDK/Tracking/Model/VSDKRemoveFromCart.m
Original file line number Diff line number Diff line change
@@ -1,3 +1,4 @@
#import "VSDKProduct.h"
#import "VSDKRemoveFromCart.h"

@implementation VSDKRemoveFromCart
Expand All @@ -9,4 +10,10 @@ - (instancetype)init {
return self;
}

+ (Class)classForCollectionProperty:(NSString *)propertyName {
if ([propertyName isEqualToString:@"products"])
return [VSDKProduct class];
return nil;
}

@end

0 comments on commit eb865c6

Please sign in to comment.