Hi,
I was working on building the LocationDetailsViewController ~p95, and had 2 questions:
-
When do you embed a navigation controller to a view, versus when you just present it modally? I noticed you could still add a navigation bar from the objects library, without a navigation controller. So are there any conventions around this?
-
Why in the segue for CurrentLocationViewController you set the variables in the other controller to variables inside this controller, while in the segue for the Checklist app, in the AllListViewController, you set it to the sender. What does the sender mean/do?
override func prepare(for segue: UIStoryboardSegue, sender: Any?) {
if segue.identifier == “ShowChecklist” {
let controller = segue.destination as! ChecklistViewController
controller.checklist = sender as! Checklist
override func prepare(for segue: UIStoryboardSegue, sender: Any?) {
if segue.identifier == “TagLocation” {
let navigationController = segue.destination
as! UINavigationController
let controller = navigationController.topViewController
as! LocationDetailsViewController
controller.coordinate = location!.coordinate
** controller.placemark = placemark**
}
}
Thanks so much!