Advertisement
Guest User

Untitled

a guest
Jun 20th, 2019
59
0
Never
Not a member of Pastebin yet? Sign Up, it unlocks many cool features!
text 2.29 KB | None | 0 0
  1. class NewMainTableViewController: UITableViewController, UITextFieldDelegate, MiniTabBarDelegate, NVActivityIndicatorViewable {
  2. var items: [Device3] = []
  3. var itemsNew: [Device3New] = []
  4.  
  5. let cellId: String = "cellId"
  6. let cellIdNew: String = "cellId"
  7. override func viewDidLoad() {
  8. super.viewDidLoad()
  9. tableView.register(DeviceTableViewCell2.self, forCellReuseIdentifier: cellId)
  10. tableView.register(DeviceTableViewCell2.self, forCellReuseIdentifier: cellIdNew)
  11. }override func tableView(_ tableView: UITableView, cellForRowAt indexPath: IndexPath) -> UITableViewCell {
  12.  
  13. let cell = tableView.dequeueReusableCell(withIdentifier: cellId, for: indexPath) as! DeviceTableViewCell2
  14.  
  15. if((chipnumber2.text?.isEmpty) != true) {
  16.  
  17. let cellNew = tableView.dequeueReusableCell(withIdentifier: cellIdNew, for: indexPath) as! DeviceTableViewCell2
  18.  
  19. let deviceItem: Device3New = itemsNew[indexPath.row]
  20.  
  21. cellNew.badgeColor = UIColor.flatLime
  22. cellNew.badgeTextColor = .white;
  23. cellNew.badgeFontSize = 13;
  24. cellNew.badgeString = deviceItem.time
  25. cellNew.badgeOffset = CGPoint(x:30.0, y:63)
  26.  
  27. cellNew.deviceItem3New = deviceItem
  28. cellNew.titleNew.text = deviceItem.title
  29. cellNew.title1New.text = deviceItem.places
  30. cellNew.titlesaatNew.text = deviceItem.time
  31. cellNew.buttonNew.isOn = deviceItem.state
  32.  
  33. cellNew.tablerow = String (indexPath.row)
  34.  
  35. cellNew.backgroundColor = UIColor(white: 1, alpha: 0.09)
  36.  
  37. return cellNew
  38.  
  39.  
  40. }
  41.  
  42. if((chipnumber.text?.isEmpty) != true) {
  43.  
  44. let deviceItem: Device3 = items[indexPath.row]
  45.  
  46. cell.badgeColor = UIColor.flatLime
  47. cell.badgeTextColor = .white;
  48. cell.badgeFontSize = 13;
  49. cell.badgeString = deviceItem.time
  50. cell.badgeOffset = CGPoint(x:30.0, y:63)
  51.  
  52. cell.deviceItem3 = deviceItem
  53. cell.title.text = deviceItem.title
  54. cell.title1.text = deviceItem.places
  55. cell.titlesaat.text = deviceItem.time
  56. cell.button.isOn = deviceItem.state
  57.  
  58. cell.tablerow = String (indexPath.row)
  59.  
  60.  
  61. cell.backgroundColor = UIColor(white: 1, alpha: 0.09)
  62.  
  63. return cell
  64.  
  65. }
  66. return cell
  67.  
  68. }
  69.  
  70. }
Advertisement
Add Comment
Please, Sign In to add comment
Advertisement