swifty-json
How to loop through JSON with SwiftyJSON?
If you want loop through json[“items”] array, try: for (key, subJson) in json[“items”] { if let title = subJson[“title”].string { println(title) } } As for the second method, .arrayValue returns non Optional array, you should use .array instead: if let items = json[“items”].array { for item in items { if let title = item[“title”].string { … Read more
SwiftyJSON object back to string
From the README of SwiftyJSON on GitHub: //convert the JSON to a raw String if let string = libraryObject.rawString() { //Do something you want print(string) }
Module compiled with swift 3.0 cannot be imported in Swift 3.0.1
SwiftyJson is being downloaded precompiled by carthage. The precompiled download is with Swift Version 3.0. That makes the compiler complain that the version is not correct. Using the following command: carthage update –platform iOS –no-use-binaries SwiftyJson (and all other frameworks within Carthage) will be compiled locally using the local version of Swift (3.0.1) and the … Read more