From the course: Building a Note-Taking App for iOS 11 with Swift
Unlock the full course today
Join today to access over 22,400 courses taught by industry experts or purchase this course individually.
Handle table view row deletions
From the course: Building a Note-Taking App for iOS 11 with Swift
Handle table view row deletions
- [Instructor] Now that we can create add items to our table view, let's look at deleting items from the table view. The first step in that is to add a button to put the table view in editing mode. To do that, I'm going to go inside of viewDidLoad at the very bottom and I'm going to set the bar button item for the left. So self.navigationItem.leftBarButtonItem, we're going to set that equal to editButtonItem. So this property is actually a property of the view controller class already. So it's built into the UI view controller, which is the super class of our view controller class. And when we do that and actually test the application, we should see an Edit button at the top left of the screen. And there it is at the top left right here when the application runs. If you click the Edit button, it's going to change to say Done, and if you hit Done, it goes back to Edit. So this built-in system item toggles between those two words. In addition to that, the button actually triggers a…
Practice while you learn with exercise files
Download the files the instructor uses to teach the course. Follow along and learn by watching, listening and practicing.