5
Programmatic Views

In this chapter, you will update WorldTrotter to create the view for MapViewController programmatically (Figure 5.1). In doing so, you will learn more about view controllers and how to set up constraints and controls (such as UIButton instances) programmatically.

Figure 5.1  MapViewController with programmatic views

MapViewController with programmatic views

Currently, the view for MapViewController is defined in the storyboard. The first step, then, is to remove this view from the storyboard so you can instead create it programmatically.

In Main.storyboard, select the map view associated with the map view controller and press Delete (Figure 5.2). As in Chapter 4, this might be easier to do from the document outline.

Figure 5.2  After deleting the view

After deleting the view
..................Content has been hidden....................

You can't read the all page of ebook, please click here login for view all page.
Reset
3.17.68.14