From 4d0a95044a982ddda3a61e8a246eb2ff75e38bf0 Mon Sep 17 00:00:00 2001 From: V-Ken Chin Date: Thu, 27 Oct 2016 15:15:21 +1100 Subject: [PATCH] Change JSONAPIResource protocol func name `-(id)ID;` will be genereted to `func id() -> Any?` in Swift 3.0 which conflicts with internal function --- Classes/JSONAPI.m | 6 +++--- Classes/JSONAPIResource.h | 2 +- Classes/JSONAPIResourceParser.m | 8 ++++---- 3 files changed, 8 insertions(+), 8 deletions(-) diff --git a/Classes/JSONAPI.m b/Classes/JSONAPI.m index 6026dc1..ed672ae 100644 --- a/Classes/JSONAPI.m +++ b/Classes/JSONAPI.m @@ -125,7 +125,7 @@ - (void)inflateWithDictionary:(NSDictionary*)dictionary { JSONAPIResourceDescriptor *desc = [JSONAPIResourceDescriptor forLinkedType:data[@"type"]]; NSMutableDictionary *typeDict = includedResources[desc.type] ?: @{}.mutableCopy; - typeDict[resource.ID] = resource; + typeDict[resource.iD] = resource; includedResources[desc.type] = typeDict; } @@ -136,7 +136,7 @@ - (void)inflateWithDictionary:(NSDictionary*)dictionary { JSONAPIResourceDescriptor *desc = [JSONAPIResourceDescriptor forLinkedType:data[@"type"]]; NSMutableDictionary *typeDict = includedResources[desc.type] ?: @{}.mutableCopy; - typeDict[resource.ID] = resource; + typeDict[resource.iD] = resource; includedResources[desc.type] = typeDict; } @@ -190,7 +190,7 @@ - (NSDictionary *)mapIncludedResources:(NSArray *)relatedResources forResource:( for (NSObject *linked in relatedResources) { JSONAPIResourceDescriptor *desc = [[linked class] descriptor]; NSMutableDictionary *typeDict = includedResources[desc.type] ?: @{}.mutableCopy; - typeDict[linked.ID] = resource; + typeDict[linked.iD] = resource; includedResources[desc.type] = typeDict; } return includedResources; diff --git a/Classes/JSONAPIResource.h b/Classes/JSONAPIResource.h index bd38b1e..e67daf7 100644 --- a/Classes/JSONAPIResource.h +++ b/Classes/JSONAPIResource.h @@ -115,7 +115,7 @@ * * @return The record identifier for a resource instance. */ -- (id)ID; +- (id)iD; /** * Set the API record identifier for a resource instance. Required for resources that come diff --git a/Classes/JSONAPIResourceParser.m b/Classes/JSONAPIResourceParser.m index be4c087..2a87c62 100644 --- a/Classes/JSONAPIResourceParser.m +++ b/Classes/JSONAPIResourceParser.m @@ -309,7 +309,7 @@ + (void)link:(NSObject *)resource withIncluded:(JSONAPI*)jsonAP NSObject *res = obj; id includedValue = included[[[res.class descriptor] type]]; if (includedValue) { - id v = includedValue[res.ID]; + id v = includedValue[res.iD]; if (v != nil) { matched[idx] = v; } @@ -324,7 +324,7 @@ + (void)link:(NSObject *)resource withIncluded:(JSONAPI*)jsonAP id res = value; id includedValue = included[[[res.class descriptor] type]]; if (includedValue) { - id v = included[[[res.class descriptor] type]][res.ID]; + id v = included[[[res.class descriptor] type]][res.iD]; if (v != nil) { [resource setValue:v forKey:key]; } @@ -371,10 +371,10 @@ + (NSDictionary*)link:(NSObject *)resource from:(NSObject