TestsTested | ✗ |
LangLanguage | SwiftSwift |
License | MIT |
ReleasedLast Release | Mar 2017 |
SwiftSwift Version | 3.0 |
SPMSupports SPM | ✗ |
Maintained by pjk1129.
SONetwork is an HTTP networking library based URLSession written in Swift.
SONetworking.request("POST", url: url, parameters: dic, success: { (jsonString) in
let data = jsonString?.data(using: .utf8)!
if let parsedData = try? JSONSerialization.jsonObject(with: data!) as! [String:Any] {
let data = parsedData["data"] as? Array<[String:Any]>!
var result = [SOGoodsItem]()
for dic in data! {
let item = SOGoodsItem(dict: dic)
result.append(item)
}
success(result)
} else {
print("bad json - do some recovery")
}
}) { (error) in
}
iJecky http://weibo.com/rubbishpicker
SONetwork is available under the MIT license. See the LICENSE file for more info.