Created
May 14, 2019 19:49
-
-
Save daniloc/06fc4bbf36510f0045a3fd7f9bc08684 to your computer and use it in GitHub Desktop.
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
@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) | |
} | |
} |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment