I have an object that is an instance of a class similar to this:
class MyClass {
let aString: String
let bString: String
var cArray = [AnotherClass]()
init etc...
}
AnotherClass is something like:
class AnotherClass {
let aInt: Int
let bInt: Int
var cFloat = Float
init etc...
}
Ok, now i need to pass that object (instance of MyClass) as a POST request string parameter with the following format:
{
"aString": "1",
"bString": "yannis",
"cArray": [
{
"aInt": 1965887,
"bInt": 36513032311523,
"cFloat": 1.0
},
{
"aInt": 1916915,
"bInt": 360397932121597,
"cFloat": 1.0
}
]
}
Any ideas how to achieve this? I'm using Swift 1.2 (and SwiftyJSON, if that helps) Thanks!