The documentation fails to mention that when using storyboards, the LocationPicker controller should be embedded in its own navigation controller as well if 'Done' and 'Cancel' buttons are used. Otherwise, the 'parent' navigation controller is dismissed due to the call to dismissViewControllerAnimated.
Alternatively, the code could check whether LocationPicker is the root view controller and if not, call navigationController.popViewControllerAnimated instead.
The documentation fails to mention that when using storyboards, the LocationPicker controller should be embedded in its own navigation controller as well if 'Done' and 'Cancel' buttons are used. Otherwise, the 'parent' navigation controller is dismissed due to the call to
dismissViewControllerAnimated
.Alternatively, the code could check whether LocationPicker is the root view controller and if not, call
navigationController.popViewControllerAnimated
instead.