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

How to post nested json by SwiftyJson and Alamofire?

try this func test() { var exampleParameters : [String : Any] = [“b” : “bv”] exampleParameters[“a”] = [“a1”: “v1″,”a2”: “v2″] debugPrint(exampleParameters.description) let devUrlPush = URL.init(string:”yourURL”) var request = URLRequest(url: devUrlPush!) request.httpMethod = “POST” request.setValue(“application/json”, forHTTPHeaderField: “Content-Type”) request.httpBody = try! JSONSerialization.data(withJSONObject: exampleParameters) Alamofire.request(request).responseJSON { (response) in if( response.result.isSuccess) { }else { } } let string = … Read more