Created
January 28, 2019 07:09
-
-
Save buddies2705/5792b7b4c6d68743be5f30c4d3569ff8 to your computer and use it in GitHub Desktop.
ViewController
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
class ViewController: UIViewController { | |
override func viewDidLoad() { | |
super.viewDidLoad() | |
self.getKoinData() | |
} | |
func getKoinData(){ | |
ServiceManager.getRequestWithFullUrl("BASE_URL", success: { | |
(responseObject) in | |
print(responseObject) | |
let inrList = responseObject["stats"]["inr"].map { | |
return $1 | |
} | |
let bitcoinList = responseObject["stats"]["bitcoin"].map { | |
return $1 | |
} | |
let rippleList = responseObject["stats"]["ripple"].map { | |
return $1 | |
} | |
let etherList = responseObject["stats"]["ether"].map { | |
return $1 | |
} | |
let inrModelList = inrList.map { | |
KoinModel(jsonObject : $0) | |
} | |
let bitcoinModelList = bitcoinList.map { | |
KoinModel(jsonObject : $0) | |
} | |
let rippleModelList = rippleList.map { | |
KoinModel(jsonObject : $0) | |
} | |
let etherModelList = etherList.map { | |
KoinModel(jsonObject : $0) | |
} | |
let koinModelObject = finalKoinModel() | |
koinModelObject.inrList = inrModelList | |
koinModelObject.bitcoinList = bitcoinModelList | |
koinModelObject.rippleList = rippleModelList | |
koinModelObject.etherList = etherModelList | |
appDelegateObj().finalModelObject = koinModelObject | |
appDelegateObj().mainRootView() | |
}) | |
{ | |
(errorObject) in | |
print(errorObject) | |
} | |
} | |
} |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment