iOS Programming: The Big Nerd Ranch Guide (5th Edition) (Big Nerd Ranch Guides)
Christian Keur, Aaron Hillegass
iOS Programming: The Big Nerd Ranch Guide leads you through the essential concepts, tools, and techniques for developing iOS applications. After completing this book, you will have the know-how and the confidence you need to tackle iOS projects of your own. Based on Big Nerd Ranch's popular iOS Bootcamp course and its well-tested materials and methodology, this bestselling guide teaches iOS concepts and coding in tandem. The result is instruction that is relevant and useful.
Throughout the book, the authors explain what's important and share their insights into the larger context of the iOS platform. You get a real understanding of how iOS development works, the many features that are available, and when and where to apply what you've learned.
select AppIcon from the resource list on the lefthand side (Figure 1.26). Figure 1.26 Showing the Asset Catalog This panel is the Asset Catalog, where you can manage all of the images that your application will need. Drag the Icon@2x.png file from Finder onto the margins of the AppIcon section. This will copy the file into your project’s directory on the filesystem and add a reference to that file in the Asset Catalog. (You can Control-click on a file in the Asset Catalog and select the
may surprise you: they are all structures. In fact, all of these Swift types are structures: Numbers: Int, Float, Double Boolean: Bool Text: String, Character Collections: Array
let leadingConstraint = segmentedControl.leadingAnchor.constraintEqualToAnchor(view.leadingAnchor) let trailingConstraint = segmentedControl.trailingAnchor.constraintEqualToAnchor(view.trailingAnchor) topConstraint.active = true
much better to use the margins of the view controller’s view. Every view has a layoutMargins property that denotes the default spacing to use when laying out content. This property is an instance of UIEdgeInsets, which you can think of as a type of frame. When adding constraints, you will use the layoutMarginsGuide, which exposes anchors that are tied to the edges of the layoutMargins. The primary advantage of using the margins is that the margins can change depending on
and the objects can be positioned and sized relative to this view. To begin specifying Auto Layout constraints, select the top label by clicking on it either on the canvas or in the document outline. At the bottom of the canvas, notice the Auto Layout menus, shown in Figure 1.17. Figure 1.17 The Auto Layout menus With the top label still selected, click on the Figure 1.18. icon to reveal the Align menu shown in Figure 1.18 Centering the top label in the container