Designing the User Interface

You’ll design your interface by selecting your Main.storyboard file and laying out the buttons and label as depicted in Figure 21.17. (Of course, feel free to design the interface to your liking.)

Make the connection from each digit button you lay out in your view to the clickDigit: method. Do this by Control-click-dragging each button in turn to the clickDigit: method either in the interface or implementation file for your view controller. Also, for each digit button, in the Inspector pane set the Tag value to the number that corresponds to the button’s title. So, for the digit button labeled 0, set the Tag value to 0, for the digit button labeled 1, set the Tag value to 1, and so on.

Draw the remaining buttons in ...

Get Programming in Objective-C, Sixth Edition 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.