Guest User

Untitled

a guest
Jan 23rd, 2018
79
0
Never
Not a member of Pastebin yet? Sign Up, it unlocks many cool features!
text 0.57 KB | None | 0 0
  1. var options = ["Solstice", "Equinox", "Enable Snapshot"]
  2.  
  3. public func tableView(_ tableView: UITableView, numberOfRowsInSection section: Int) -> Int {
  4. return options.count
  5. }
  6.  
  7. public func tableView(_ tableView: UITableView, cellForRowAt indexPath: IndexPath) -> UITableViewCell {
  8.  
  9. let cell = tableView.dequeueReusableCell(withIdentifier: "CustomCell", for: indexPath) as! CustomCell
  10. let switchView = UISwitch(frame: CGRect.zero)
  11. cell.addSubview(switchView)
  12. cell.accessoryView = switchView
  13. cell.nameLabel.text = options[indexPath.row]
  14. return cell
  15. }
Add Comment
Please, Sign In to add comment