swift - SwiftyJSON Alamofire Cannot invoke responseJSON with an argument list of type ((_,_,_,_))->_) -


having constant issues following code swiftyjson , alamofire:

extension bool { func tostring() -> string? {     switch self {     case true:         return "true"     case false:         return "false"     default:         return nil     } } }                 var _enabled: bool?                 var _username: string?                 var _email: string?                  // bit set username, enabled , email                  let _baseurl = "https://url.com/path"                  var createuserjson = ["user": ["username": _username!, "email": _email!, "enabled": _enabled!.tostring()]]                  request(.post, _baseurl + "/users", parameters: createuserjson, encoding: .json)                     .responsejson { (request, response, data, error) in                         // blah blah stuff                 } 

for reason error cannot invoke responsejson argument list of type ((,,,))->_)

this seems happen quite regularly , fix after trial , error , bit of luck. nothing can find on stackoverflow helps

can help?

figured it, bool.tostring() function needed force unwrapping !


Comments

Popular posts from this blog

node.js - Using Node without global install -

How to access a php class file from PHPFox framework into javascript code written in simple HTML file? -

java - Null response to php query in android, even though php works properly -