Advertisement
Not a member of Pastebin yet?
Sign Up,
it unlocks many cool features!
- @IBAction func handlePuppySwitch(_ sender: UISwitch) {
- let updateIndexPaths = [IndexPath(row: 0, section: TableSections.dynamicSection.rawValue)]
- if (sender.isOn) {
- puppyLabel.text = "Puppy Enabled"
- dynamicContent.insert("Puppy is on!", at: 0)
- tableView.insertRows(at: updateIndexPaths, with: .bottom)
- } else {
- puppyLabel.text = "Puppy"
- dynamicContent.remove(at: 0)
- tableView.deleteRows(at: updateIndexPaths, with: .left)
- }
- }
Advertisement
Add Comment
Please, Sign In to add comment
Advertisement