As a courtesy, this is a full free rendering of my book, Programming iOS 6, by Matt Neuburg. Copyright 2013 Matt Neuburg. Please note that this edition is outdated; the current books are iOS 10 Programming Fundamentals with Swift and Programming iOS 10. If my work has been of help to you, please consider purchasing one or both of them. Thank you!

Part IV. Views

This part of the book is about the things that appear in an app’s interface. All such things are, ultimately, views. A view is a unit of your app that knows how to draw itself. A view also knows how to sense that the user has touched it. Views are what your user sees on the screen, and what your user interacts with by touching the screen. Thus, views are the primary constituent of an app’s visible, touchable manifestation. They are your app’s interface. So it’s going to be crucial to know how views work.

  • Chapter 14 discusses views in their most general aspect — their hierarchy, visibility, and position, including an explanation of autolayout, a way of positioning views that’s new in iOS 6.
  • Chapter 15 is about drawing. A view knows how to draw itself; this chapter explains how to tell a view what you want it to draw, from simply displaying an already existing image to constructing a drawing line by line.
  • Chapter 16 explains about layers. The drawing power of a view comes ultimately from its layer. To put it another way, a layer is effectively the aspect of a view that knows how to draw — with even more power.
  • Chapter 17 tells about animation. An iOS app’s interface isn’t generally static; it’s lively. Much of that liveliness comes from animation. iOS gives you great power to animate your interface with remarkable ease; that power resides ultimately in layers.
  • Chapter 18 is about touches. A view knows how to draw itself; it also knows how to sense that the user is touching it. This chapter explains the iOS view-based mechanisms for sensing and responding to touches, with details on how touches are routed to the appropriate view and how you can customize that routing.