Skip to content

Commit 8f7d6d7

Browse files
committed
updated docs and removed renamed methods to clear ambiguity
1 parent 97b6586 commit 8f7d6d7

File tree

3 files changed

+10
-6
lines changed

3 files changed

+10
-6
lines changed

JSONJoy.swift

+2-2
Original file line numberDiff line numberDiff line change
@@ -41,7 +41,7 @@ public class JSONDecoder {
4141
return value as? Array<JSONDecoder>
4242
}
4343
//pull the raw values out of an array
44-
public func array<T>(inout collect: Array<T>?) {
44+
public func getArray<T>(inout collect: Array<T>?) {
4545
if let array = value as? Array<JSONDecoder> {
4646
if collect == nil {
4747
collect = Array<T>()
@@ -54,7 +54,7 @@ public class JSONDecoder {
5454
}
5555
}
5656
//pull the raw values out of a dictonary.
57-
public func dictonary<T>(inout collect: Dictionary<String,T>?) {
57+
public func getDictonary<T>(inout collect: Dictionary<String,T>?) {
5858
if let dictonary = value as? Dictionary<String,JSONDecoder> {
5959
if collect == nil {
6060
collect = Dictionary<String,T>()

JSONJoy.xcodeproj/project.pbxproj

+4
Original file line numberDiff line numberDiff line change
@@ -424,6 +424,7 @@
424424
DYLIB_INSTALL_NAME_BASE = "@rpath";
425425
INFOPLIST_FILE = Info.plist;
426426
INSTALL_PATH = "$(LOCAL_LIBRARY_DIR)/Frameworks";
427+
IPHONEOS_DEPLOYMENT_TARGET = 8.0;
427428
LD_RUNPATH_SEARCH_PATHS = "$(inherited) @executable_path/Frameworks @loader_path/Frameworks";
428429
PRODUCT_NAME = "$(TARGET_NAME)";
429430
SKIP_INSTALL = YES;
@@ -441,6 +442,7 @@
441442
DYLIB_INSTALL_NAME_BASE = "@rpath";
442443
INFOPLIST_FILE = Info.plist;
443444
INSTALL_PATH = "$(LOCAL_LIBRARY_DIR)/Frameworks";
445+
IPHONEOS_DEPLOYMENT_TARGET = 8.0;
444446
LD_RUNPATH_SEARCH_PATHS = "$(inherited) @executable_path/Frameworks @loader_path/Frameworks";
445447
PRODUCT_NAME = "$(TARGET_NAME)";
446448
SKIP_INSTALL = YES;
@@ -594,6 +596,7 @@
594596
D958024219E6ED8E003C8218 /* Release */,
595597
);
596598
defaultConfigurationIsVisible = 0;
599+
defaultConfigurationName = Release;
597600
};
598601
D958024619E6ED8E003C8218 /* Build configuration list for PBXNativeTarget "JSONJoyOSXTests" */ = {
599602
isa = XCConfigurationList;
@@ -602,6 +605,7 @@
602605
D958024419E6ED8E003C8218 /* Release */,
603606
);
604607
defaultConfigurationIsVisible = 0;
608+
defaultConfigurationName = Release;
605609
};
606610
/* End XCConfigurationList section */
607611
};

README.md

+4-4
Original file line numberDiff line numberDiff line change
@@ -142,7 +142,7 @@ struct Scopes : JSONJoy {
142142
init() {
143143
}
144144
init(_ decoder: JSONDecoder) {
145-
decoder.array(&scopes) //pass the optional array by reference, it will be allocated if it is not and filled
145+
decoder.getArray(&scopes) //pass the optional array by reference, it will be allocated if it is not and filled
146146
}
147147
}
148148
```
@@ -176,10 +176,10 @@ struct Addresses : JSONJoy {
176176
}
177177
init(_ decoder: JSONDecoder) {
178178
//we check if the array is valid then alloc our array and loop through it, creating the new address objects.
179-
if decoder["addresses"].array {
179+
if let addrs = decoder["addresses"].array {
180180
addresses = Array<Address>()
181-
for address in decoder["addresses"].array {
182-
addresses.append(Address(address))
181+
for addrDecoder in addrs {
182+
addresses.append(Address(addrDecoder))
183183
}
184184
}
185185
}

0 commit comments

Comments
 (0)