Hi,
I have this code:
let params = ["parm": "getList",
"obj": "none"]
Alamofire.request("http://nazwa.pl/", method: .get, parameters: params).responseJSON { responseData in
if responseData.result.isSuccess {
if((responseData.result.value) != nil) {
let swiftyJsonVar = JSON(responseData.result.value!)
var result = responseData
print("result: \(responseData)")
if let imieINazwisko = result["imieINazwisko"] as? String {
print("ImiÄ i nazwisko: \(imieINazwisko)")
}
} else {
}
} else {
}
}
And my data:
{
"ranking": {
"id": 50971,
"nazwa": "grupowy",
"opis": "cx",
"typ": "GRUPA",
"dataWidoczneOd": {
"year": 2018,
"month": 2,
"dayOfMonth": 1,
"hourOfDay": 0,
"minute": 0,
"second": 0
},
"dataWidoczneDo": {
"year": 2018,
"month": 2,
"dayOfMonth": 31,
"hourOfDay": 0,
"minute": 0,
"second": 0
},
"dataOd": {
"year": 2018,
"month": 2,
"dayOfMonth": 1,
"hourOfDay": 0,
"minute": 0,
"second": 0
},
"dataDo": {
"year": 2018,
"month": 2,
"dayOfMonth": 31,
"hourOfDay": 0,
"minute": 0,
"second": 0
},
"idkiPlikowGrafiki": [
"50976"
],
"grupy": [
{
"id": 50981,
"idkiPlikowGrafiki": [
"50983",
"50986"
],
"kod": "ttt",
"nazwa": "ttt",
"gracze": []
},
{
"id": 51032,
"idkiPlikowGrafiki": [
"51034"
],
"kod": "yyy",
"nazwa": "yyy",
"gracze": [
{
"czasGry": "0 min",
"liczbaZdobytychPunktow": "0.0",
"email": "pawrilo@gmail.com",
"zdjecieZFacebooka": "https://graph.facebook.com/1018655608235134/picture?width=200&height=150",
"imieINazwisko": "PaweÅ OpaÅa",
"zakonczonaGra": false
},
{
"czasGry": "0 min",
"liczbaZdobytychPunktow": "0.0",
"email": "lukasz.peta@icloud.com",
"zdjecieZFacebooka": "https://graph.facebook.com/201192440635362/picture?width=200&height=150",
"imieINazwisko": "Åukasz Betta",
"zakonczonaGra": false
}
]
}
]
}
}
i have problem with error. error: Type āDataResponseā has no subscript members?
How can I repair it?