With controls in place, connect up outlets and actions in Xcode. Learn about the major differences between iOS and watchOS actions, and how to name outlets and actions following Swift 3.0 style guidelines. Learn how to remove an outlet and clean a project.
- With the interface layout complete,…it's time to connect the outlets…to the interface controller.…Use the assistant editor to do this.…Close up all the panels so you have yourself some room.…Notice I did leave the document outline open.…On a simple application like this one, I could close it,…but there are several objects only accessible…by the document outline.…So I usually leave it open.…Open the assistant editor…and slide the storyboard so you can see the interface.…
If it's too big, hit the minus to zoom out.…In this application, we won't need any of the template code.…Remove everything from the class, then add some space.…Select the label.…Control drag to make an outlet to the label.…The connection pop-up appears.…Type the name, hello label.…Then click connect.…The outlet appears.…
Select the pizza button.…Control drag from the pizza button…and make an outlet named pizza.…Press return.…The outlet appears.…Actions are just as easy.…Control drag from the pizza button.…On the top of the connection pop-up,…change outlet to action.…
- Principles of watchOS development
- Adding buttons and labels to your app
- Connecting objects to code
- Testing a watchOS app
- Laying out WatchKit UI objects
- Adding navigation
- Using Interface Library elements such as inputs, pickers, and media players
- Creating tables
- Working with table data
Skill Level Intermediate
1. A Look at the Apple Watch App
2. Building Your First Apple Watch App
3. Working with UI in watchOS
5. Interface Library
6. Tables and Scrolling
Next steps1m 57s
- Mark as unwatched
- Mark all as unwatched
Are you sure you want to mark all the videos in this course as unwatched?
This will not affect your course history, your reports, or your certificates of completion for this course.Cancel
Take notes with your new membership!
Type in the entry box, then click Enter to save your note.
1:30Press on any video thumbnail to jump immediately to the timecode shown.
Notes are saved with you account but can also be exported as plain text, MS Word, PDF, Google Doc, or Evernote.