Learn about three different formats for images in pickers, and implement scrolling images in pickers.
- [Instructor] You've seen a Text Picker…but that's not all you can do with Pickers.…There are three variations where you can use…images in your Picker.…We'll use the project from the previous Picker lesson.…Stop the app.…You'll find in the Downloads…a file called Assets with six images.…Go to the Assets.xcassets folder…of the WatchKit app.…Select all six images, using shift select,…and drag them into the Assets folder.…
Open the Attributes,…with all of them still selected,…change from Universal to Apple Watch,…and then drag each into the frame for the Apple Watch.…The images have the same name as the flavors.…This way, I can get the image from the ice cream name.…
Let's go back to the code,…hit InterfaceController.swift,…and head to refreshPickerItems.…Under caption,…add let…image equal WKImage,…imageName,…iceCreams,…and we'll use the index.…Get rid of the Attributes inspector.…
There are two image properties of WKPickerItem,…the accessory image and the content image.…Under the image line that we just typed, add this.…
- 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.