Skip to content

Instantly share code, notes, and snippets.

@randhirraj3130
Created June 29, 2018 10:12
Show Gist options
  • Save randhirraj3130/5caf222a7cb871f5861211d61c9291fe to your computer and use it in GitHub Desktop.
Save randhirraj3130/5caf222a7cb871f5861211d61c9291fe to your computer and use it in GitHub Desktop.
How to set and get data from model class
// set data be like this
var dataList = [Any]()
for items in DataArray
{
let data = RunnningJobModel.initWithDictionary(dictionary: items as! NSDictionary)
self.dataList.append(data)
}
// get data be like this
let data: RunnningJobModel? = (self.dataList[0] as? RunnningJobModel)
//handler(dataList as NSArray?,true)
print("data array for running job.", data?.bid_amount, data?.job_id)
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment