Skip to content

Instantly share code, notes, and snippets.

@shaktiprakash099
Created December 7, 2018 10:50
Show Gist options
  • Star 0 You must be signed in to star a gist
  • Fork 0 You must be signed in to fork a gist
  • Save shaktiprakash099/0fe033e9e26d5b9da029dc52ad153631 to your computer and use it in GitHub Desktop.
Save shaktiprakash099/0fe033e9e26d5b9da029dc52ad153631 to your computer and use it in GitHub Desktop.
extension ItemsListsViewController:UITableViewDelegate,UITableViewDataSource{
func tableView(_ tableView: UITableView, heightForRowAt indexPath: IndexPath) -> CGFloat {
return 80.0
}
func tableView(_ tableView: UITableView, numberOfRowsInSection section: Int) -> Int {
return itemLists.count
}
func tableView(_ tableView: UITableView, cellForRowAt indexPath: IndexPath) -> UITableViewCell {
let cell = tableView.dequeueReusableCell(withIdentifier: "ItemListsTableViewCell", for: indexPath) as! ItemListsTableViewCell
let itemlist = itemLists[indexPath.row]
cell.userNamelable.text = "\(itemlist.firstName) \(itemlist.lastName)"
cell.userEmailIdLable.text = "\(itemlist.emailId)"
if let imageUrl = URL(string: itemlist.imageUrl) {
cell.userImageView.sd_setImage(with: imageUrl,placeholderImage: #imageLiteral(resourceName: "defaultavatar"))
}
return cell
}
}
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment