
It can be overwhelming getting started with accessibility in Apple iOS. The operating system has so many features, tools, and APIs. This is where the action plan will be helpful. The plan has three main points: VoiceOver, Dynamic Type, and good practices.
Dani recommends focusing on VoiceOver. However, this doesn’t mean you shouldn’t test your app with the keyboard, switch control, or voice control. The underlying APIs to implement a good VoiceOver experience are the same across all these technologies. If you implement a good VoiceOver experience, you’ll probably have a good experience with the other ones.
Dynamic Type makes it possible to specify up to seven different text sizes for different apps. You can also add five extra accessibility sizes. Many people who use Dynamic Type don’t identify as disabled or that they’re using assistive technology. It’s an important reminder that making apps accessible benefits everyone. Good practices refer to things that are not related to iOS technologies like color contrast and touch target sizes.
By the way, did you know that the first iPhone was not accessible at all? If you’d like to know the story of 36 Seconds That Changed Everything, check out this audio with a full transcript from Shelly Brisbin.
VoiceOver
VoiceOver is the screen reader that comes installed on most Apple devices. While using an iPhone, you can move your finger around the screen and VoiceOver will announce what you touch. Anyone not using VoiceOver typically only has to tap an item once to interact with it, such as turning a feature on or off.
When VoiceOver users tap once, VoiceOver says what they’re selecting. Interacting with the iPhone running VoiceOver requires tapping twice. Another important thing to know about interacting with VoiceOver is that users often swipe right to go to the next element. They swipe left to go to the previous one.
The first thing to know is that a single block of text can contain four properties. For example, you use an app to rate conferences. There’s a text field with the name of the conference. Next to it is a rating with five thumbs up. In VoiceOver, it’ll say something like “Rating 5 of 5. Adjustable. State how much you like the conference.”
In this example, the label is the rating, which is the name of the component. The value is 5 of 5 and this can change as it’s adjustable, which is an accessibility trait. The part about “rating how much you like the conference” is a hint. This is optional and you want to design to prevent the need for a hint.
The main issue in an iOS app is unlabeled buttons consisting of just an icon. If the button has an icon and text as a title or just a title, the accessibility label gets inferred from that text. But if it’s just an image, then you need to configure that explicitly.
Otherwise, VoiceOver will just say, “Text button.” Sometimes, VoiceOver will try to figure out what the button does. And it will say something like “Close button,” but that’s not a great experience. It’s just one line of code. You have to consider other things like if a button contains meaning.
Another important trait is the heading. Everything that looks like a header should have the heading trait. It helps the user browse the screen and quickly find different sections. You can combine a heading with another accessibility trait such as a button.
After you select and configure labels and traits correctly, one issue that happens a lot is that VoiceOver doesn’t group things logically, known as semantic views.
There are three steps to good semantic views:
- Grouping
- Configure the properties: label, value, traits, hints, etc.
- Custom actions
SwiftUI is a user interface toolkit that can do all three steps with one line of code. It’s not possible in every case, but it’s worth testing to determine if it makes sense.
Dynamic Type
Dynamic Type is for both small and large text sizes. It also looks at user preferences. Be aware when you get to the maximum size, all the tiles are the same size and you can still have a sense of hierarchy. It’s super easy to implement as it’s a matter of selecting a font based on style. Nonetheless, it will still need design considerations. As you increase the text size, the styles get closer and closer together.
Something you want to know is that there’s a property that lets you say a label is going to automatically scale to the text size selected by the user. If you don’t have the property and the user changes the settings while using the app, it’s not going to adapt. The only thing to do is to close and reopen the app. If this property is set to true to adjust the font for the size category, then it will automatically adapt when the user changes their preference.
A cool thing you can do with dynamic type is autolayout. For instance, you could be using a device that’s 13 inches in landscape. Having a line of text going from the left edge of the screen to the right is too long. Add multiple lines and it adds friction to the reading experience. Fortunately, there’s a readable content guide that handles that for you to prevent the width problems.
You can make it so images adjust automatically when the user uses an accessibility text size. Dynamic Type is not that difficult, but all layouts may not be designed with large text sizes in mind.
An example you can see everywhere is a table view style that has an image and some text. The text doesn’t have the whole width of the screen. And that’s the problem with large text sizes. But in iOS, you can check if the user is using an accessibility text size.
A useful trick is if you have what is called a stack view, that is a horizontal stack view, with an image on the text. If the viewer wants to use the accessibility text size, then switch the text to be vertical on the text. The image is going to come first, and then underneath the image you have the text.
This has two benefits. It lets the text go from side to side to the screen, plus you can increase the number of lines. Now you can grow as much as you want.
And the other trick that can help you with Dynamic Type is when you have a layout that has multiple columns. Like a weather app with two columns for indicating things like the UV index or sunset time or the wind or the rainfall. If the user is using a text size that is larger than extra-large or it’s an accessibility text size, then change it from two columns to one.
Good Practices
Color contrast ratios are important. Apple has a color contrast checker that shows the color contrast ratio and whether it passes or fails for three different sizes. White over black, for instance, has a 21:1 contrast ratio and passes for three text sizes. Then dark grey over black has a 4.5:1 ratio, which passes two out of three sizes. Then a light grey over black has a contrast ratio of 2.9:1, which fails everything.
Another good practice is having a touch target size of at least 44 points minimum. Almost everyone has encountered a time when they try to tap a button in an iOS app and they have to try it many times before they finally hit the button. In most cases, the button doesn’t have to look different. It’s the size of the button that’s small.
When you compare two images of a player, they are the same size. The only difference is the buttons are less than 44×44 points on one screen. The other has more than 44×44 points. The only difference is the bounding boxes are larger and creates a better experience.
Another example is the lack of multimodality. This means showing important information in just one mode, which could be color, shape, sound, or haptic feedback. But a combination of these expands the number of users who can perceive the information.
A good example of this is the shuffle button on the Spotify app. When it was off, the button was white. When it was on, the button turned green. But that’s hard for some users to perceive the differences between the two states on color alone especially those who are colorblind. The designers fixed this but adding a small dot under the shuffle icon when it was in the on state.
The next tip is to honor the user’s settings. When iOS 7 came out, Apple dropped skeuomorphism for the new flat design most apps use now. Back in the day, apart from being a revolution in how apps looked on the phone, it was a big step back for accessibility.
That’s because the fonts were super thin. The color palette had poor contrast. There were lots of transparencies, and lots of animations, and some users didn’t feel like iOS 7 worked for them. As a result, Apple found a way to fix that in iOS 8 by adding a set of user preferences. Users could select bolder text or larger text, on/off labels for switches, reduce transparency of the apps, and reduce motion.
Before dark mode was a thing, iOS had invert colors. Most of the iOS apps had a white background and black text or grey text on a dark background. Some users found it hard to read the app. So, they used the invert colors feature to change it from white text on a background. It was easier to read. However, when you invert the colors, it inverted everything including the images that you wouldn’t want to invert.
Then Apple introduced smart invert colors. This gives developers the opportunity to opt an image out of being inverted. While the name is smart invert colors, it still requires the developer’s intervention in telling it what not to invert.
The Plan
The plan to create accessible iOS starts with VoiceOver. It doesn’t mean you don’t have to think about the other technologies and test them. If you’re just starting and feel overwhelmed, then focus on VoiceOver along with labels, traits, semantic views, and its snowball effect. It was the first of these technologies to be introduced. Many iOS engineers have gotten into the habit of testing with VoiceOver.
Dynamic Type with its text, images, and alternative layouts is important. It has design considerations and it’s one of those things that if you do right from the beginning, it’s not hard to do. However, if you want to adapt a whole app to use large text sizes, then it’s a nightmare. This is when accessibility can gain a reputation for being hard.
And finally, good practices are things you need to keep in mind when implementing something new. These good practices include color contrast, touch target sizes, multimodality, and honoring the user’s settings.
In 2009, just after the first iPhone was introduced, Phil Silver came onto the stage to present VoiceOver. He spoke for 36 seconds about accessibility in iOS. And that’s why the name of the aforementioned documentary is “36 Seconds That Changed Everything.” There was no live demo and 36 seconds is not much. But it changed the iPhone forever. VoiceOver was the first feature you could zoom the screen. There were two or three more features. But they were basic.
The point is that it’s progress over perfection. If you feel overwhelmed, remember Apple had an inaccessible iPhone from day one. It took two years for them to present the first feature. Now they’re just one of the leaders of the sector. You have to just start with something and be persistent.
It’s not a one-day job. It’s not a one-person job. It’s something that you just have to get used to. You practice, and it becomes second nature. Actually, you quickly realize iOS has many great APIs and many great tools. A lot of times, big problems can be solved with a couple of lines of code.
The problem is when you leave it all to the end. When someone comes to you and asks how to make something accessible, don’t give them a list of 50 items. That will paralyze them and they will think there’s no time to do it. However, if those 50 items are 50 lines of code, then it’s not much. Often, people don’t know about it. Accessible development is a 365-day job.
Resources
- Dani’s thread of tweets for 365 days
- #365DaysIOSAccessibility hashtag on Mastodon
- #365DaysIOSAccessibility hashtag on LinkedIn
- 36 Seconds That Changed Everything from Shelly Brisbin
- Apple accessibility hub
- Sommer Panage is an inspiration to Dani. Follow Sommer on Twitter or Follow Sommer on Mastodon
Video Highlights
Select any of the bullets to jump to the topic on the video.
- Introduction
- The plan to create accessible iOS apps
- VoiceOver
- Dynamic Type
- Good practices
- Q&A with Dani
Watch the Presentation
Transcript: Creating Accessible iOS Apps: An Action Plan - Daniel Devesa Derksen-Staats
DANI: Yeah. I call this talk: Creating accessible iOS apps, an action plan. And the idea is that if you are just starting as an iOS engineer, or if you are already an iOS engineer, and you don't know much about accessibility, or you just want to know more about accessibility in iOS, it can be a bit overwhelming, now that you have so many features, so many tools, so many APIs. So... I tried to make an action plan, to... Yeah. As a way to start in this amazing but massive field. To make things a bit clearer. Yeah. As Cameron said, hi, I'm Dani. I work in the amazing accessibility team at Spotify. I've been doing these tweets, posting on LinkedIn about tips about how to make iOS apps more accessible. And a few years ago, I wrote a book about it. I
have one copy. So the first question at the end of the presentation gets a free book. Yeah. This is my plan. So... Three main points. VoiceOver, Dynamic Type, and good practices.
So I would recommend to focus on VoiceOver. That doesn't mean you shouldn't test your app with keyboard or switch control or voice control. But the underlying APIs to implement a good VoiceOver experience are the same across all these technologies. So the chances are that if you get to implement a good VoiceOver experience, you'll probably have a good experience with the other ones as well. Dynamic Type is quite a unique feature for iOS. I love it. It's the possibility to select different text sizes in the system. You can even specify different text sizes for different apps. And you have 7 sizes, but you can actually enable 5 extra accessibility sizes. So it gets pretty big. And what I love from this one is: I'm pretty sure it's the most widely used accessibility feature in iOS. But most people using Dynamic Type wouldn't
consider themselves disabled or wouldn't consider they're using an assistive technology. So I think it's a great reminder that if we make apps accessible, they just benefit everyone. Both my parents use large text size. I think most of us will probably get to that point as well.
And good practices -- what I mean by that is just things that you may -- most of you may not be aware of. These are things that are not technically related to iOS technologies. But more things like color contrast, touch target sizes, and things like that. So let's start. And yeah, it all started in 2007, when Steve Jobs presented the iPhone. In the slide, you can see a sketch of Steve Jobs, holding the first iPhone in his hand. The interesting thing is that the first iPhone was not accessible. This audio documentary, called 36 Seconds That Changed Everything, that I totally recommend, will talk more about it. And there's a QR code at the end of the presentation.
But... Yeah. It's by Shelly Brisbane and is a great story to hear. I think it's important, because these days we think of Apple as the leading company in the field of accessibility. And it's just shocking, right, that the first iPhone was not accessible at all? We all know that this story has a happy ending, but I think it's a good thing to know.
So yeah. Let's start with VoiceOver. So if you haven't used VoiceOver before in the iPhone, or iPad, or watch... Any Apple platform... It's the screen reader that comes preinstalled for free in pretty much all the -- all Apple devices. And in the iPhone, you can move your finger around the screen, and then VoiceOver will speak and announce what you're touching. And because tapping means VoiceOver telling you what you're selecting, a double tap anywhere in the screen is an interaction. So if you're focusing on a button, a double tap will interact with that button. But more commonly, a lot of times, users will swipe to the right to go to the next element, go to the left to go to the previous one. It's important to know these two paradigms with VoiceOver. In the slide, as a joke, I used an Apple Newton
instead of an iPhone. But there's an app it keep track of your favorite conferences. In this case, it's a text field. And it says: NSSpain. And there's a rating that says five thumbs up.
If you do this with VoiceOver, it will say something like: Rating 5 of 5, adjustable. State how much you like the conference. And this is not just a single block of text, but it's actually four different properties. And these four different properties are really important to understand, how the accessibility model works in iOS.
In this case, the label is rating. And that's the name of the component. Value is 5 of 5. And that can change. And it's like the state of the component. Adjustable is what is called an accessibility trait. There are seven different traits, if I remember correctly, in UIkit. Most of them are the same. And it's basically... Like the role of the component. It kind of tells the user and the system a bit more about how you can interact with it. And then rate how much you like the conference is what you call a hint. Which is optional. You strive for not needing a hint. For the components to be... To have enough context for you to understand how to use it. But sometimes you may need some extra clarification. And users can actually skip it. So it's a good
thing to have. But be mindful that not all of the users will listen -- will listen to it. And the whole talk could be about accessibility labels. But let's talk about more things.
The main issue in any iOS app is unlabeled buttons that consist of just an icon. If the button has an icon and a text, as a title, or just a title, the accessibility label gets inferred from that text. But if it's just an image, then you need to configure that explicitly. Otherwise, VoiceOver will just say text button, for example. Will try to figure out something that makes some sense, like the name of the image. But that's not always the case. Sometimes we use names of images that are a bit... Random, basically. Sometimes VoiceOver will even try to figure out what the button does. And it will say something like -- possibly close button. But that's not a great experience. It's just one line of code. Definitely an issue that you can see in lots of apps.
And then some other things, like... That you have to consider... Is... Button contains meaning. This is a simple example in the Spotify app. A play button, you interact with it, then it's a pause button. If you don't update the label, you might be confused -- how do I pause the music, right?
And then let's check a few traits. We mentioned the button trait, which just tells the user this is an interactive thing that you can double tap in the screen to interact with it. Buttons in iOS have the button trait by default, so most of the time you don't have to configure that. But if you create a button from scratch, you have to specify that it's a button.
Two very common scenarios, where apps miss the button trait, are: Table views and collection views -- most of the time, where the cells you can tap to, for example, move you to another screen, or to do some action. In the slide, there's a collection view. And a cell. If you tap it, you go to a podcast screen. And there's a table view. And each cell, if you tap it, you play some music.
So... If those don't have the button trait, the user may not know that you can do something with them. Then the heading trait is super important as well. Lots of apps have hidden traits as well.
It's one of my favorite quick wins to improve VoiceOver. Everything that looks like a header should have a heading trait, and that helps the user browse in the screen, they can find different sections, but more importantly, it helps the viewer navigate quickly through the screen. In the slide, there are two sections. Podcast and artist. The podcast section has 12 podcasts. So if we don't have a heading configuration and the user is swiping to the right, trying to find the next section is like 12 swipes. Right? But if you get the heading right, you can actually swipe once and go from podcasts to artists with a single interaction.
So another one is selected, for example. In Spotify, we used to have a hard button. That's one instance when we use the selected trait. If it was in a field, it would say something like "like button". If it was in field, it would say something like "selected like button". Just an example.
And another important thing to know is that accessibility traits can be combined. And you can have header, for example, that is a button as well. Because it's going to open on a different screen, with more information about that section. Or you can have, like the example said, a button that is selected. So those are different traits.
And once you have labels and traits configured correctly, one other issue that happens a lot of times in VoiceOver is not grouping things in a logical manner. What is called usually semantic views. To achieve good semantic views, there's three steps. The first one is grouping. So imagine the Twitter app. A single tweet can have a status, like the tweet was retweeted. It can have the user name. It can have the user handle, the date, the tweet itself, media, a bunch of actions you can do, like more options, reply, retweet, like, share. So... In the example in the screen, you need 11 swipes to go through one tweet to get to the next one. That's just way too much. Usually what you like is a single swipe to go to
the next tweet. To simplify the navigation. So one thing you can do is to make that cell that represents a tweet an accessibility element. But that comes with some issues.
The first one is that when you make something an accessibility element, you need to configure all the other properties. The label, the value, the hint, everything. So you need to think what makes sense to configure one of the properties that we saw before. Otherwise, VoiceOver will focus on that element, but will just not announce anything.
So that's something important to know. And the third step is: We talked about how a single tweet can have multiple actions. Like live, retweet, reply, share, on all those. Because those buttons are inside an accessibility element, they're not accessible anymore.
So the way to solve that is with something that in iOS is called custom actions. And there's an array, called accessibility custom actions. And you can basically define which actions the user can do with that element. When an element has actions, you can usually swipe up and down to rotate through those different actions. We'll start announcing all those.
Activate, which is the default, reply, retweet, and then once you hear the one you want to interact with it, you double tap in the screen, and... It's done.
Sometimes you need to use what's called the rotor. So you rotate two fingers in a concentric point in the screen. The rotor is a super cool feature in iOS. It lets you customize navigation modes. So, for example... You could select actions, if they're available, you can change the speed that VoiceOver announces things, change the language of VoiceOver -- things like that.
In SwiftUI, there's a super convenient way of doing this. Which is what is called a modifier called accessibility element. And you can just combine all of those. And most of the time, SwiftUI is smart enough to know -- to do all these three steps in just one line of code. Not all the time. And it's good to test it, to see that it actually makes sense.
But... I think it's a really nice improvement in SwiftUI. Custom accents that we've seen are super useful as well. When you can interact with some, in a way that interferes with VoiceOver gestures. So, for example, when you think about an email app, you can do things like swipe left or right to flag an email, reply, or delete. If you do that with VoiceOver, you're going to go to the next element or previous element instead. So you can use custom actions.
And we talked about focusing on VoiceOver first. And I wanted to show a few examples on why I think that's a good idea. So it has this novel effect. That when you improve the experience with VoiceOver, you're improving the whole accessibility of your app.
In this case, in the example in the screen, there's the Twitter app, that we've seen before. But using it with switch control. Switch control has the same issue, if you don't group things in a logical way. Switch control, for those of you who may know, is a way to use your phone with switches, or as little as a single button, for example.
So some users may have a cursor that's moving around the screen. And then you can press that button to stop in a position, and then press again to show and press again to interact with that element. So you can see how navigation is quite expensive. And by grouping elements together, it becomes a much easier experience.
And then when you create custom actions, they appear in what is called the switch control menu. So there's a very convenient way to interact with all those actions from the tweet, in this case. Then the same happens with a keyboard. You can go from one element to the other. If tweets are an accessibility element, then a single interaction is going to bring you the next tweet, instead of having to go through every single element inside that tweet. And there's a command at the top, the Z shortcut, that is going to open a menu with all the actions. So again, grouping things together, using custom actions, the experience is improved for keyboard users as well.
And then voice control is a bit different. It may be a little bit of a worse experience. But it's a trade-off that I think is totally justifiable. So if you think about it... With voice control, you have to say something like: Show numbers. And then you'll have a tag, on top of every tweet. And then you can say something like: Show actions for 6, for example. And then it shows a menu with all the actions. And you can say: 3. And the example of the screen -- it will like that tweet.
Because voice control doesn't have this issue of having an expensive navigation, by grouping things together, and hiding the custom actions, you actually have an extra step to get to the custom actions. Otherwise you could just say something like... Tap like. And then you'll have a label in every single like button on the screen, and you could say something like: Tap one. And that's it. But as you can see, I don't think... The main problem here is discoverability. Because not every user may know about this command of show actions, for example. And now let's talk about Dynamic Type.
In the slide, you can see these four examples. One with the extra small size. One with the default size, which is called large. Extra, extra, extra large. And then the accessibility -- extra, extra, extra large size. An important thing to know is that Dynamic Type is not just for larger text sizes, but also smaller ones. It's about user preference as well.
For the accessibility, extra, extra large, I think the interesting thing to know is that... Not all these tiles scale proportionately. When you get to the maximum size, all these tiles are pretty much the same size. You can still find some sense of hierarchy. But they got much closer together. I think that's super smart, because the large titles tile is quite large, but the body title is quite small. So it's fair to think that... The body size is gonna be like... To need much higher -- higher increase of size. In principle, it's super easy to implement and it's just selecting a font based on a style. That's pretty much it. The issue, though, is that it's going to need some design considerations that we will see in a minute. It's the same thing -- you can see
how styles come closer and closer and closer together as you increase text sizes.
Just a couple things as well. There's a property that lets you say this label, for example, is going to automatically scale to the text size selected by the user. I don't know why this is not on by default. But basically, if you don't have it, and the user changes settings while they're using your app, it's not going to adapt. You have to close the app and open again. But if you have this property set to true, which is adjust font for size category, it will automatically go, when the user changes this configuration.
There's a bunch of really cool things we can do with dynamic type. In this case, autolayout. One of the things is like... You may think sometimes... What's the idea with a line of text? You have, for example, an iPad that is almost 13 inches, and you have it in landscape...
Having a line of text that goes from the very left edge of the screen to the right one is just too long. And if you have multiple lines, it gets very difficult to read. And there are studies that indicate -- what's the ideal width for the line? But if you're using a large text size, it's useful to actually have the whole screen, from side to side.
So just for you not to have to think about it, there's what is called a content guide in iOS. Readable content guide, and that handles all of that to you. In the iPad as well, you can have split screen. And in that case, you want to fix the width of the screen as well, because it could break how your app looks in split screen. And another quick one. You can also make it so images also adjust automatically. When the user uses an accessibility text size.
So we spoke about design considerations. And the thing is that... Another thing about Dynamic Type per se, it's not that difficult, as we have seen it. But all layouts may not be designed with large text sizes in mind. An example you can see everywhere is like a table view style that has an image and some text. So the text doesn't have the whole width of the screen.
And that's the problem with large text sizes. But in iOS, you can actually check if the user is using an accessibility text size. Or say... If it's larger than the extra, extra large size, I'm going to do some text in the layout. And a very useful trick is if you have what is called a stack view, that is a horizontal stack view, with an image on the text, you can say: If the viewer wants to use the accessibility text size, I'm going to switch the text and it's going to be vertical on the text. The image is going to come first, and then underneath the image you have the text. That has two benefits. It lets the text go from side to side to the screen, plus you can increase the number of lines. Now you can grow as much as you want.
And the other trick that can help you with Dynamic Type is: You have a layout that has multiple columns, like the weather app tends to have two columns for indicating things like UV index or the sunset time or the wind or the rainfall. You can say... Well, if the user is using text size that is larger than extra large, or is an accessibility text size, then let's go from two columns to one. Again, that lets you use the screen.
And then another time -- when you enable large text sizes, why is it not increasing the text size of the navigation bar and the tap bar? Seems like a fair thing to do. But the thing is like... If you do that, it would take too much space of the screen, leaving very little space for content. So the workaround is something called large content previews. If you're using an accessibility text size and you tap and hold your finger on the tap bar, you're going to see a large window in the middle of the screen with whatever you're tapping. So for example, if there's a navigation bar with the title "watch now", and you tap and hold, then you see the text: Watch now. Very big in the middle of the screen.
And then we can talk about good practices. And the first one is color contrast. And I think in this slide, from one of the WW from Apple -- it's useful, because it shows you how white over black is 21 to 1 contrast ratio. And it passes for any text size.
Then there's a gray to black, which is 4.1 to 1. And you can see how the smaller text size is very difficult to read and it doesn't pass. And the third one is a darker gray over black. Which is 2.9 to 1. And you can see how even the large text size is impossible to read. That's something that in the iOS community, it's not super well known. Color contrast ratios are important.
And also the size of the text is important as well. So I think this is super useful.
And then you're meant to have touch target sizes of 44 points minimum.
Again... I think we've all been there. Where you tried to tap a button in an iOS app and you have to try many times to finally hit the button. Most of the time it doesn't even need to look different. It's just that the size of the button is small. In the screen, there's an example of a player, and the bounding boxes of the buttons in the first example are right around the icons. So they're super, super small. The second example looks exactly the same. But the bounding boxes are bigger. And it looks the same -- but it's just a much better experience for everyone. You can imagine that in apps that are going to be used with touch controls, a lot of times, this is super, super important. And then a consequence of this not being super well known in the iOS community as well
is the concept of multimodality. Not showing important information in just one mode. Meaning color or shape or sound. Or haptic feedback. But a combination of all of those. Not all of those. But a combination of some of those. So all your users can perceive that information. An example I really like to show is: The shuffle button in Spotify. It used to be white, when it was off, and green when it was on. But then for some users, that might be really difficult to perceive. The difference of those two states. Just by the color. If you, for example, are colorblind.
So... What the designers of Spotify did was to add a button -- sorry. A circle, a small dot.
Underneath the shuffle icon when it was on. So that simple change now makes it so much easier actually for everyone to identify. And it has become kind of part of the brand of Spotify.
And another thing is: User settings. So I don't know if you remember when iOS 7 was released and Apple dropped skeuomorphism, the new flat design that now governs every single app in the world. But back in the day, apart from being a revolution in how apps looked in the phone, it was a big step back, in terms of accessibility. Because the fonts were super thin. The color contrast -- the color palette had a really poor contrast. There were lots of transparencies, lots of animations, and some users really didn't feel like... IOS 7 worked for them.
So in iOS 8, Apple introduced a kind of a way of fixing that. And it's just a set of user preferences. So from iOS 8, a user can request bolder text or larger text, or on/off labels for switches, or to reduce transparency of the apps. Or to reduce motion, which is super important as well. And as developers, we have access to those settings. And ideally, a user wouldn't need to enable any of those settings for the app to be accessible.
So... Ideally, the color contrast is good enough so a user doesn't need to go to that setting. But you might want an even better contrast for some users. What happens, though, all of the time, designers say: Let's go with this color palette that's not passing WCAG guidelines, because we can use this setting for a user to have an experience that works for them.
Yeah... Which is really not... Try not to do that. That should be like -- just an improvement. But the baseline should be already accessible.
Also, I'd like to say... Imagine you're using your phone and you try to turn on the Wi-Fi or Bluetooth, or you change the volume of your device, and it doesn't work. Like... You would be completely mad that that's happening. Right? Why a user shouldn't feel mad if you request, let's say, larger text sizes, and your app doesn't do anything.
One that I would like to show as well is: Before dark mode was a thing in iOS, we had a feature called invert colors. So because most of the apps would be white background and black text, or ideally gray text on dark -- some users would find it difficult to read the app that way. So they would use this feature to invert the colors. Because they would find it probably easier to read white text over a black background, for example.
And then Apple introduced something that is called smart invert colors. Because if you inverted the colors of the screen, the issue was that you were inverting everything, including images. And that's something that you probably didn't want to invert. It's called smart invert, but actually, as a developer, you have to say: Actually, this image I'm going to opt out of being inverted. So it's not that smart. You have to tell it which things you want not to invert.
In the example in the slide -- the Books app with the Steve Jobs up. The first is how it looks like default, the first is the classic invert, where you can see that the book cover is inverted, and is in narrative mode, and the third one, all the colors are inverted, but the cover stays as it looks in the default mode. In the iOS community, I would like to say: More importantly, Steve Jobs's turtleneck was black, but not white. So it's important to do that.
So this is the plan. VoiceOver first. It doesn't mean you don't have to think about the other technologies. And test them. But again, if you're just starting, if you're feeling overwhelmed, I think it's fair to say... Let's focus on something. And VoiceOver was actually the first of these technologies that I mentioned that was introduced. So I think a lot of iOS engineers have got in the habit of testing with VoiceOver. Dynamic Type is another one that is super important. Because it has, as we've seen, design considerations. And it's one of those things that if you do right from the beginning, it's not difficult, as we've seen.
But if you want to adapt a whole app to use large text sizes, then it becomes a complete nightmare. And it's when accessibility sometimes gets this reputation of being difficult -- it wasn't difficult. It's just that -- it happens the same with testing, right? If you create a whole app, and now you say... Okay. Now I'm going to create tests for this app... It's a lot of work.
Because you may need to refactor things. And things may not work. And things may break. Yeah. Better to have in mind from the beginning.
And then... All these good practices that are just things that you have to remind yourself...
And to keep in mind when you are implementing something new as well.
So again, yeah. This slide is showing how in 2009, just after the first iPhone was introduced, Phil Silver came on to the stage to present VoiceOver. He spoke for 36 seconds about accessibility in iOS. And that's why the name of the documentary that I said is 36 Seconds That Changed Everything. There was no live demo or anything. 36 seconds is not much.
But it actually changed the iPhone forever. In the slide, there's also... A sketch of how the accessibility setting screen looked like. And VoiceOver was the first feature you could zoom the screen as well. There were two or three more features. But they were super basic.
So... My point with this is... As we say a lot of times... It's progress over perfection.
If you feel overwhelmed, think... Apple had an inaccessible iPhone from day one. And it took two years for them to present the first feature. And now they're just one of the leaders of the sector. So... You have to just start with something. And to be persistent. And a lot of times, people come to me and say: What's the point of implementing Dynamic Type in one screen, if the whole app is not supporting it? Well, it's a start. And if you don't implement it in that screen, it's just worse. And you're never going to have the time to tackle the issue for the whole app. So... It's a way to start. And you'll see how surely but slowly, you can make progress and make it better and better.
And... Yeah. I would like to say as well: It's not a one day job. It's not a one person job.
It's something that you just have to get used to. You practice, and it becomes second nature. Actually, you quickly realize -- in iOS, we're super lucky, because we have so many great APIs, so many great tools. Some of the slides -- the code was just there to show you that a lot of times, these big problems are solved with a couple lines of code. And as we've said, the problem is when you leave it all to the end. And when someone comes to you and says: How do I make this accessible? And you submit a list of 50 items. And then they become like... Paralyzed, and they think... We don't have the time to do that. But those 50 items are 50 lines of code, which is not much. It's just people don't know about it, usually. So... Yeah. Just 360 days job.
Thank you. I tried to make it on time. Thanks. CAMERON: Thank you, Dani! And thank you so much for your work. And expertise, and for sharing that with us today. I'm gonna open to questions. And we also have the livestream. So...
I'm gonna give -- yeah. Brian, right here.
Thanks. This is great, Dani. Thank you. Watching this, I'm struck by how much of these APIs in iOS require opt-in on the part of the developer. Even like the Dynamic Type, it seems like... I've got to call a pretty long string of APIs, and what I really care about is that enum value at the end. .body or .heading or whatever.
Is there a discussion between the big adopters, like yourself, and the folks over at Apple, to try to make these things a little bit... Why doesn't the UI text element just automatically just say -- tell me what type of element this is. Body. Instead of having you opt in?
DANI: Yeah. Great question. I think it comes... A lot of times, it's just for backwards compatibility. Yeah. So... If you think that suddenly Apple says... Well, now all labels are going to automatically grow... Most of the apps would break. So I guess there's this balance of: Do we break all of them? So we force them to fix it? But then the users are going to have the pain of not being able to use any of those apps for a long time? Probably. Some of them may not even care to fix it. Or do we do it opt-in, so apps will update when they want? It's a tricky one. I was showing in the iOS conference two days ago... There's these properties you have to set to false, when you create UIs in iOS. It's called translate authorizing mask
to constraints. Something like that. It's a big joke in the community. Because sometimes you spend minutes and minutes, hours, trying to find out why your layout is not displaying as you want to.
Just to find out that you forgot to set that property to false. And that's kind of... Let us see the pain. You used to use these authorizing masks in iOS back in the day.
And everyone is thinking... Why is this not set to true? And at some point, it probably will be. But I think it comes back to not breaking what you have. Which is strange. Because sometimes Apple just forces all of us to update. Yeah.
It seems like with the release of SwiftUI, these are new components that people aren't already using. So there's not that much legacy stuff to worry about breaking at that point. If people are like... Oh, you're opting into using SwiftUI, and you have those new components, there was an opportunity to bake this in by default.
DANI: I have to say, SwiftUI is much more accessible than UIkit. A lot of these things work by default. You actually have to opt out for them not to work. It's just that developers tend to opt out without knowing what they're doing. If you specify a font with a specific size, you're basically saying... This text is always going to be this size.
CAMERON: Other questions in the room? A couple questions on the stream too. One of the questions from the stream is: Can you share a few design patterns from the web that don't translate well to the iOS platform? I have a similar question. But... Yeah.
DANI: Okay. That's a good one. I'm not super knowledgeable about web patterns. But I guess the most obvious one was -- at some point, every single app had a hamburger menu over on the left.
And nowadays very rarely you find an app with that pattern. And yeah. It was just because I guess... Apps wanted to put every single option somewhere. But apps tend to be useful when they're simple and right to the point and they display -- they make accessible firsthand the most useful things.
You don't have to have a list of 20 options right there. I hope that answers the question.
CAMERON: Yeah. That's helpful. I think a lot of people come from a web background, in accessibility. I see where the questions are coming from. And I have a similar question about -- Safari on iOS, respecting some of these configurations. Like... What percentage of these settings actually get passed through to the web content author? So, for example, I know... Reduce motion is a CSS media query that you can hook into, as a content creator. Are there others that we should know about, that are like... Oh my gosh. How did I not know that I could do this in CSS? When the user asked for it? DANI: Right. One that I know about is -- you can actually adopt Dynamic Type. CAMERON: Really?
DANI: Yeah. I can actually try to find it. Somewhere. Because I just found it randomly somewhere, that you can do it. And I think... Actually, Apple proposed it to be standardized. But... Let me see. CAMERON: That was actually exactly what I was hoping! Because the idea... Anyone else here who works in web accessibility might be aware of reflow and resize requirements under WCAG 2.1 AA. It's a requirement that you be able to zoom text to very large sizes, and still have the application layout and content make sense, loosely. So this idea of zooming everything proportionally... Or disproportionally... Makes a lot of sense. And it's something that we don't really think about as well developers. Like...
What if I zoomed things out of sync, so to speak? So I thought that was a really cool insight, that we could take from iOS, into web.
Do we have other questions in the room? DANI: This is how it works, more or less. Oops. I lost it. Yeah. This one, yeah.
CAMERON: Amazing. DANI: I don't know much about web development. But... You have these Apple system body style... Apple system headline style...
And so I just use this sometimes for simple HTML files inside an app. Like terms and conditions or privacy policy. Because those make a lot of sense, that they scale with Dynamic Type as well. Although you can zoom -- but this is a much better experience for iPhones.
CAMERON: Do you know if this works on... It works on iOS Safari, presumably. Does it work on Safari on MacOS? DANI: Good question. I don't know.
CAMERON: This is amazing. Thank you for showing me this. I'm gonna go and play with this.
Yeah. Other questions?
Thank you. A lot of apps are unfortunately just web views. Would you say there is a strong accessibility case for not building your app with a web view? That those of us who are trying to deter that can use?
DANI: Right. I'm completely biased, because I'm a native developer. And I actually really like developing native apps for many reasons. Including performance. And I think the experience tends to be more free and much better. But... I don't think you can make the accessibility case, because the webapp may be more accessible. We said -- right? A lot of engineers come from the web engineering world, and they may have much more experience in accessibility. So it just comes down to how much effort you put into making it accessible, I guess. But it's true that if you create apps, native iOS apps, the way Apple proposes, or with their recommendations -- things tend to be super, super accessible with almost no work. The problem comes when you want to make things from scratch, reinvent the wheel, or just customize things to a level that Apple doesn't
allow you to do. That's when accessibility gets, like, thrown out of the window, and you have to invent it yourself. And if you then... Yeah... You don't take that into account, then it's broken. I like this concept of: Apps are accessible by default, and then we break them.
CAMERON: I'll take another question from the stream here. Okay. So... Are there any new features or recommendations you would have for future updates to the UI accessibility API? What is your dream of like a feature, accessibility feature, that you want and need? DANI: Oh. That's a good one, but a difficult one as well. I'm curious about something that I heard is going to happen. And it's that...
Apple seems to be going to release a simplified mode or something like that.
CAMERON: I saw this recently. Yeah, yeah. They sneaked it somewhere. It's for the home screen.
It's not just application-specific. So what you're talking about is a simplified mode for across all of the platform? DANI: Exactly. And I'm curious, because... Yeah.
We always think... You shouldn't have, like, two different experiences. Right? That's just going to make it even more difficult to maintain. But if they're doing it, I guess they might have some way of doing it with... Like... Very small effort? But it's a tricky one as well. Because I can see how, again, some teams may think... Well, if we have the simplified mode, we can make as complex as we want the default app. And that's not ideal either. But... Let me think about a new...
Apple just surprises us, I think, every year. Some recent things that they've released -- like audio graphs, that feature as well. CAMERON: Yeah, audio graphs are amazing.
Keep going. I'm just handing off the mic. DANI: I was trying to think about... At some point, I had a wish list. But now I just blanked. But if I can remember, I'll come back to that one.
I've been having conversations with a number of different people in the native app space. And commonly bemoaning the lack of clarity from W3C on how to map guidelines to native. And the need to fill that... Like... In some way, with consistent and kind of approved guidance. But, as you mentioned, Apple surprises us every year. Google surprises us every year. And the pace of change of the landscape is so different than it is in web standards that it's hard to create a resource that is both kind of generically applicable across use cases, and able to live and not go stale... Given the pace of change in the two platforms.
Do you have a way that you work with your teams or coach your teams to...
Translate and apply those guidelines in a way that you feel is consistent and kind of scalable? Because I feel like a lot of us are all doing that work in silos, because there's no kind of global guidance. And everybody is kind of doing their own work in the context of their own business. But not in a way that really scales or kind of spans across the use cases. And across the platforms. So do you have any thoughts, other than... We all just need to form our own working group and go do it? On how to kind of consistently apply those, when it comes to native?
DANI: Yeah, you're completely right. Standardization is always behind the real world use cases and technologies. I think we're moving in the right direction, though. The closest thing I've seen is... A few years ago, I used to work for the BBC. They started a great job of having a simplified version of the guidelines, and also taking mobile into account.
They had even code snippets, and tips on how to test those scenarios. To me, that's the closest we've got to something like that. It's just that unfortunately I don't see it's maintained a lot. But yeah. So as you said... Maybe we need to all team up with the work with the W3C, to -- in Spotify, we tend to work -- but as you said -- we may work in different silos. We tend to work with system design language teams, to make sure that those guidelines are baked in, the basic components from the ground up. So when an engineer comes to use one of those components, they almost don't have to think about these things.
Yeah. I feel like... In a lot of... A lot of folks on the web side will say: You know, regardless of what framework you're working in, JavaScript framework, you always have native semantics to fall back on. And you can get a lot of the accessibility behavior that's intended, quote-unquote, for free, if you leverage native semantics and native components.
When we're talking about... And that's for HTML native. When we're talking about native app cross platform frameworks like Flutter or .NET Maui, React Native, a lot of them -- Flutter, for example -- has its own approach to accessibility. But you can't actually go native in the same way. You can't fall back to the native accessibility traits.
And so I feel like it's not even just two native platforms that we have to keep up with. But it's all of the ways that the cross platform frameworks compile down to native. And obviously native Swift, native Objective C is one use case. But for those of us that end up in all the different frameworks and doing work in all the different frameworks, it's...
Yeah. An interesting nut to crack. DANI: Yeah, it is. And a lot of times, as well, people can think about mobile as -- you see it as one thing. But you have more than one. You have iOS on Android, you have mobile web, and you have a whole different story.
All these cross platform technologies. I remember working with React Native. And I believe they're getting much better, but... Someone told me to implement a way of being able to select some text.
And it turns out that the text component in React Native implements underneath a UI label. Which doesn't let you select text. At least select from -- because of the whole thing -- but not part of it. So... It was pretty much impossible. It was such a huge task. It didn't make sense.
And I can see how a lot of times you can have similar things with accessibility. And as you said, because you cannot get to the native aspect of it, you can test ways to implement it, when they... Yeah. I think Dynamic Type is a great example of what we're talking about. Like... These guidelines of... Having at least 200% increase of the text size. It doesn't really apply. But you can agree that Dynamic Type is a very, very good experience as well. That's a tricky one.
Thanks, everyone. It's been a pleasure.
Bio
Daniel “Dani” Devesa Derksen-Staats has his dream job as an iOS engineer on Spotify’s amazing Accessibility team. He has previously loved working at Skyscanner and the BBC, where he learned a ton about how to make iOS apps more accessible. Sometimes he lets Xcode have a break and spreads the love for accessibility at conferences.
Author of the Developing Accessible iOS Apps book, he keeps himself busy by writing a daily tweet about accessibility and iOS with the hashtag #365DaysIOSAccessibility Follow him on Twitter at @dadederk.