Learn how to code a picker, and learn about the types of pickers available and the use of the WKPickerItem to load items into the picker. Learn how to get a selection from the picker.
- [Instructor] The Picker Control is an object…for selection of multiple items.…You can use the picker to display…other images or text for selection.…In this lesson,…I'll show you how to create a text-based picker.…Load the WKPicker project from the exercise folder…or set it up yourself.…I've done some setup for you here.…I added two labels and a picker.…In the interface storyboard, select the picker.…You'll see four attributes of a picker.…Style, focus style, indicator and enable.…
Click on style and make sure it's set to list.…We'll discuss the other styles later.…Set the focus style…to outline with caption.…This will show an outliner on the picker…and have a caption at the top.…This caption is content sensitive to the picker selection.…You have a watch and a set of complication,…you are familiar with this focus style.…Close the attribute inspector…and head over to InterfaceController.swift.…
I've already set the three outlets in the action.…I set two label outlets, pickerText and typeLabel.…We'll use these labels to show…
- 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.