
To give your UI the flexibility to adjust to as many lines as needed, set the lineLimit to the maximum number of lines you need to support.
#Wwdc 2021 watch code#
In the code for my PlantTaskLabel, I'm assigning a lineLimit of 1 to everything in the HStack, which only allows the text to expand over a single line. Next let's fix the truncating text in the task list. So if I take a look at my PlantView code again, I can make that change quickly and easily by changing my title font to the title3 text style for a smaller-sized title. By using a text style, the system will automatically adjust the font size with the system text size settings. And when scaled up to the largest text size, they grow to the size of the text styles on the right. The text styles on the left are displayed at the default system text size. Rather than using a fixed font size, I should be using one of the 11 text styles provided. That's definitely going to stop my title from changing size. Notice the font I've used for my title is using a fixed font size. If I inspect the code for my PlantView, I have a VStack with the title and other content inside. Let's take a look at how our app can better support Dynamic Type. Then when I move up to accessibility extra large on the right, the task list text size has grown so large that it has truncated and no longer fits all the information on the screen. But if I change the system text size to extra small, as shown on the left, you'll notice that while the buttons and the task list text resizes, the plant name title stays the same size. Here I'm showing you what the app looks like when the system text size is at its default size it looks pretty good. Since this is an informative app, each cell contains a fair amount of text. And by tapping on the cell, I can adjust the number of days between watering and fertilizing. Then for each plant, I have two buttons that I can use to log a task such as when I water or fertilize. I have a few other plants in the list here, too. Now, it's not quite finished, but on the main screen here I have all the information on my plants, including an upcoming schedule of plant care tasks: water in five days, fertilize in seven days, and keep in a medium amount of sunlight. Now, isn't the best way to learn something new to build an app? Luckily I've become quite invested in growing plants at home so I decided to go ahead and build an app to help take care of them. Complications and dynamic notifications also need to support our assistive technologies, as they act as another path delivering content from your app. And when making your apps accessible, don't forget about complications and notifications. However, know that all the principles you learn here will apply to WatchKit as well. This talk will focus on accessibility for SwiftUI. Supporting accessibility with the right APIs will ensure that VoiceOver functions correctly for your users, regardless of whether your app is written with WatchKit or SwiftUI. Let's talk about visual accessibility on watchOS. watchOS also offers several display accommodations such as Reduce Motion, Bold Text, and also new this year, large accessibility text sizes. Virata will show you how this works later on and what you can do to support it. AssistiveTouch allows those with motor impairments to use their Apple Watch without the need to touch the screen at all. And brand new on watchOS this year is AssistiveTouch, which has been reimagined specifically for the Apple Watch.
#Wwdc 2021 watch full#
For example, assistive technologies such as VoiceOver allow people with visual impairments full use of their Apple Watch by navigating a screen using a series of gestures and taps while content is read back to them. On the Apple Watch, we have a large suite of accessibility features that can make using your app easier. And that means, to give your app the best user experience, accessibility must be considered. Accessibility is about people using their devices in the way that's best for them.

Let's get started with accessibility on watchOS. And finally, Virata will walk you through how motor accessibility works on the watch and what you can do to support it.


Then I'll dive into the accessibility APIs and show you what you can do to support different types of visual accessibility. In today's talk, you'll first be introduced to accessibility on watchOS. In this talk, my colleague Virata and I are going to go over some of the accessibility features on watchOS and how you as a developer can build your watch apps to support the people who use these features.

♪ Bass music playing ♪ ♪ Daniel Sykes-Turner: Hi, my name is Daniel Sykes-Turner and I'm an accessibility engineer.
