this header to see about 3 dozen headers that make up the library We use a map, a center point for our map, a location manager to get the user’s current location, and a locations array for our data source.
it with a custom frame that centers it on the device. We set showsUserLocation so that we’ll see the blue dot that tracks your movements. For the center point - we use a familiar C struct CLLocationCoordinate2D, that has two doubles - latitude and longitude
use a CLLocationManager object. Managers are almost always direct descendants of NSObject. They’ll have a collection of specific properties and methods For the data source - we use a mutable array (an array that can add or remove values). The array will contain custom objects that we will create. These objects will represent the various locations.
the object? Anywhere but specifically for MapStack: 1) Our map 2) To populate data for our table view cells 3) In our detail view when a user taps on a table view cell 4) In our favorites view controller for favoriting locations 5) In our global singleton (sparingly)
you put here. The view hasn’t been laid out yet. 2) set<someProperty>. In the setter, subviews are often initialized. 3) viewDidLoad. The view is loaded into memory via presentViewController or pushViewController or setViewControllers. 4) viewWillAppear. For code you want executed every time the controller is atop the window hierarchy. 5) viewWillLayoutSubviews. Typically set frames here as this gets called when the device orientation changes amongst other events (e.g. when a table is reloaded). 6) viewDidAppear. Put animation code here to ensure that the animation block fires and to ensure that the user doesn’t see the view after the animation has begun.