Sign In Start Free Trial
Account

Add to playlist

Create a Playlist

Modal Close icon
You need to login to use this feature.
  • Book Overview & Buying Learning Swift
  • Table Of Contents Toc
  • Feedback & Rating feedback
Learning Swift

Learning Swift

By : Andrew J Wagner
4.8 (5)
close
close
Learning Swift

Learning Swift

4.8 (5)
By: Andrew J Wagner

Overview of this book

If you are looking to build iOS or OS X apps using the most modern technology, this book is ideal for you. You will find this book especially useful if you are new to programming or if you have yet to develop for iOS or OS X.
Table of Contents (13 chapters)
close
close
12
Index

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 bar at the top of the editor:

This mode causes the second view to automatically change to the most appropriate file according to what you selected on the left-hand side. In this case, because we work with the interface of our view controller, it shows...

Unlock full access

Continue reading for free

A Packt free trial gives you instant online access to our library of over 7000 practical eBooks and videos, constantly updated with the latest in tech

Create a Note

Modal Close icon
You need to login to use this feature.
notes
bookmark search playlist font-size

Change the font size

margin-width

Change margin width

day-mode

Change background colour

Close icon Search
Country selected

Close icon Your notes and bookmarks

Delete Bookmark

Modal Close icon
Are you sure you want to delete it?
Cancel
Yes, Delete

Delete Note

Modal Close icon
Are you sure you want to delete it?
Cancel
Yes, Delete

Confirmation

Modal Close icon
claim successful

Buy this book with your credits?

Modal Close icon
Are you sure you want to buy this book with one of your credits?
Close
YES, BUY