Skip to content

Instantly share code, notes, and snippets.

@flandy84
Last active April 6, 2016 07:29
Show Gist options
  • Save flandy84/62b7a0e552f73e8ee4aa20042f1e8c0e to your computer and use it in GitHub Desktop.
Save flandy84/62b7a0e552f73e8ee4aa20042f1e8c0e to your computer and use it in GitHub Desktop.
import Foundation
public class LoginResponse {
public var text: String = ""
public init (text: String) {
self.text = text
}
public init(json:JSON) {
text = json["user"]["text"].stringValue
}
public func toJSON() -> JSON{
//
// {
// "user" : {
// "text" : "Hallo <USER>",
// }
// }
let bodyJSONDictionary = JSON(
[ "user" :
[
"text" : text,
]
])
return bodyJSONDictionary
}
}
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment