O'Reilly logo

Learning Swift by Andrew J Wagner

Stay ahead with the world's most comprehensive technology and business learning platform.

With Safari, you learn the way you learn best. Get unlimited access to videos, live online training, learning paths, books, tutorials, and more.

Start Free Trial

No credit card required

Allowing picture taking

Now we are ready to move onto the programming part of our app. The first thing we need to allow the user to do is to take a new picture. In order to do that, we need to run some code every time the user taps on the Add button. We achieve this by connecting the trigger action of the add button to a method on our view controller. Normally, we make a connection by right-clicking and dragging from the button to the code. However, we can't do this if we can't see the interface and the code at the same time. The easiest way to do this is to display the Assistant Editor. You can do this by navigating to View | Assistant Editor | Show Assistant Editor. Also, make sure that you can configure it to be automatic by clicking on the ...

With Safari, you learn the way you learn best. Get unlimited access to videos, live online training, learning paths, books, interactive tutorials, and more.

Start Free Trial

No credit card required