Advertisement
Guest User

Untitled

a guest
May 25th, 2019
97
0
Never
Not a member of Pastebin yet? Sign Up, it unlocks many cool features!
text 0.55 KB | None | 0 0
  1. @IBAction func handlePuppySwitch(_ sender: UISwitch) {
  2.  
  3. let updateIndexPaths = [IndexPath(row: 0, section: TableSections.dynamicSection.rawValue)]
  4.  
  5. if (sender.isOn) {
  6. puppyLabel.text = "Puppy Enabled"
  7.  
  8. dynamicContent.insert("Puppy is on!", at: 0)
  9. tableView.insertRows(at: updateIndexPaths, with: .bottom)
  10. } else {
  11. puppyLabel.text = "Puppy"
  12.  
  13. dynamicContent.remove(at: 0)
  14. tableView.deleteRows(at: updateIndexPaths, with: .left)
  15. }
  16. }
Advertisement
Add Comment
Please, Sign In to add comment
Advertisement