Advertisement
Not a member of Pastebin yet?
Sign Up,
it unlocks many cool features!
- class NewMainTableViewController: UITableViewController, UITextFieldDelegate, MiniTabBarDelegate, NVActivityIndicatorViewable {
- var items: [Device3] = []
- var itemsNew: [Device3New] = []
- let cellId: String = "cellId"
- let cellIdNew: String = "cellId"
- override func viewDidLoad() {
- super.viewDidLoad()
- tableView.register(DeviceTableViewCell2.self, forCellReuseIdentifier: cellId)
- tableView.register(DeviceTableViewCell2.self, forCellReuseIdentifier: cellIdNew)
- }override func tableView(_ tableView: UITableView, cellForRowAt indexPath: IndexPath) -> UITableViewCell {
- let cell = tableView.dequeueReusableCell(withIdentifier: cellId, for: indexPath) as! DeviceTableViewCell2
- if((chipnumber2.text?.isEmpty) != true) {
- let cellNew = tableView.dequeueReusableCell(withIdentifier: cellIdNew, for: indexPath) as! DeviceTableViewCell2
- let deviceItem: Device3New = itemsNew[indexPath.row]
- cellNew.badgeColor = UIColor.flatLime
- cellNew.badgeTextColor = .white;
- cellNew.badgeFontSize = 13;
- cellNew.badgeString = deviceItem.time
- cellNew.badgeOffset = CGPoint(x:30.0, y:63)
- cellNew.deviceItem3New = deviceItem
- cellNew.titleNew.text = deviceItem.title
- cellNew.title1New.text = deviceItem.places
- cellNew.titlesaatNew.text = deviceItem.time
- cellNew.buttonNew.isOn = deviceItem.state
- cellNew.tablerow = String (indexPath.row)
- cellNew.backgroundColor = UIColor(white: 1, alpha: 0.09)
- return cellNew
- }
- if((chipnumber.text?.isEmpty) != true) {
- let deviceItem: Device3 = items[indexPath.row]
- cell.badgeColor = UIColor.flatLime
- cell.badgeTextColor = .white;
- cell.badgeFontSize = 13;
- cell.badgeString = deviceItem.time
- cell.badgeOffset = CGPoint(x:30.0, y:63)
- cell.deviceItem3 = deviceItem
- cell.title.text = deviceItem.title
- cell.title1.text = deviceItem.places
- cell.titlesaat.text = deviceItem.time
- cell.button.isOn = deviceItem.state
- cell.tablerow = String (indexPath.row)
- cell.backgroundColor = UIColor(white: 1, alpha: 0.09)
- return cell
- }
- return cell
- }
- }
Advertisement
Add Comment
Please, Sign In to add comment
Advertisement