What We’ve Learned

We had a big job in this chapter, bringing together everything you learned about Swift programming in the first three chapters and building user interfaces in the previous chapter.

The key to doing this is creating connections in our storyboards. First, we used actions, which let us connect a UI event like a button tap to a method in our code that handles the action. Then we used outlets, which present UI elements as ordinary properties, which lets us call methods on them or change their properties.

Along the way, you also learned a little more about Swift: weak properties that make sure memory gets cleaned up when two objects reference each other, and the guard statement that’s nice for early-return logic.

We’ve done a lot ...

Get iOS 9 SDK Development now with the O’Reilly learning platform.

O’Reilly members experience books, live events, courses curated by job role, and more from O’Reilly and nearly 200 top publishers.