October 2018
Beginner
750 pages
19h 11m
English
Adding an edit button to a navigation bar is fairly straightforward. Add the following code to the viewDidLoad() method of ViewController:
navigationItem.rightBarButtonItem = editButtonItem
If you build and run your app now, you can immediately begin dragging contacts around to reorder them. However, it's not really obvious that cells are in a different state after entering edit mode. The home screen on an iPhone does a great job at indicating when it's in edit mode. The icons begin to wiggle so the user knows they can now be moved around freely.
For now, an animation like that is a little bit too advanced so, for now, the cells will just be given a different background color to indicate that they are now in a different ...
Read now
Unlock full access