Created
May 14, 2019 19:49
-
-
Save daniloc/06fc4bbf36510f0045a3fd7f9bc08684 to your computer and use it in GitHub Desktop.
Revisions
-
daniloc created this gist
May 14, 2019 .There are no files selected for viewing
This file contains hidden or 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 charactersOriginal file line number Diff line number Diff line change @@ -0,0 +1,16 @@ @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) } }