From the course: Apple watchOS 7 App Development Essential Training
Unlock the full course today
Join today to access over 22,700 courses taught by industry experts or purchase this course individually.
Digital crown - watchOS Tutorial
From the course: Apple watchOS 7 App Development Essential Training
Digital crown
- [Narrator] Of all the features of the watch, the digital crown is the most unique among Apple devices, you can quickly dial a value by rotating the crown. Since we have the ratings on the list now, I'll use ratings, we created the challenge for a personal rating. So head over to ratings detail view, the digital crown can use any floating point number, so I'm going to stick in here after menu item, a state variable for the rating. So we can see what's happening, I'm going to put on top of the V stack here, a text so that I can see the actual value of my rating. And then in here, I'm going to go down the bottom below navigation bar title here. And we're going to add two lines of code to activate the digital crown and get values for it. The first one is focusable set that to true and you've now focused the crown for the scrolling that will be happening here. And the second one is the digital crown rotation. And I've looked…
Practice while you learn with exercise files
Download the files the instructor uses to teach the course. Follow along and learn by watching, listening and practicing.