Beyond VoiceOver: making iOS apps accessible

111
Beyond VoiceOver making iOS apps accessible Sally Shepard // @mostgood Wednesday, 3 September 14

description

Slides from talk at iOSDevUK 2014. -Accessibility and disabilities -Assistive technologies on iOS -Implementing accessibility support -Testing accessibility

Transcript of Beyond VoiceOver: making iOS apps accessible

Page 1: Beyond VoiceOver: making iOS apps accessible

Beyond VoiceOvermaking iOS apps accessible

Sally Shepard // @mostgood

Wednesday, 3 September 14

Page 2: Beyond VoiceOver: making iOS apps accessible

What I’m going to cover

★ Disability & Accessibility★ Accessibility on iOS★ Adding support★ Testing

Wednesday, 3 September 14

Page 3: Beyond VoiceOver: making iOS apps accessible

Why your app isn’t accessible...

Wednesday, 3 September 14

Page 4: Beyond VoiceOver: making iOS apps accessible

Myths

• “It’s not that many people”• “It's time consuming”• “My app is too complicated to

be accessible”• “I don't know how to test it”

Wednesday, 3 September 14

Page 5: Beyond VoiceOver: making iOS apps accessible

What do I mean by ‘accessible’?

Wednesday, 3 September 14

Page 6: Beyond VoiceOver: making iOS apps accessible

Wednesday, 3 September 14

Page 7: Beyond VoiceOver: making iOS apps accessible

Wednesday, 3 September 14

Page 8: Beyond VoiceOver: making iOS apps accessible

Disability

Wednesday, 3 September 14

Page 9: Beyond VoiceOver: making iOS apps accessible

More than 1 billion people live with some

form of disability

Wednesday, 3 September 14

Page 10: Beyond VoiceOver: making iOS apps accessible

That’s 1 in 7 people

Wednesday, 3 September 14

Page 11: Beyond VoiceOver: making iOS apps accessible

Growing population

Wednesday, 3 September 14

Page 12: Beyond VoiceOver: making iOS apps accessible

Disability can make life extremely difficult

Wednesday, 3 September 14

Page 13: Beyond VoiceOver: making iOS apps accessible

We can use technology to overcome challenges

Wednesday, 3 September 14

Page 14: Beyond VoiceOver: making iOS apps accessible

How can we use technologies in iOS to overcome disabilities?

Wednesday, 3 September 14

Page 15: Beyond VoiceOver: making iOS apps accessible

Vision

Wednesday, 3 September 14

Page 16: Beyond VoiceOver: making iOS apps accessible

Wednesday, 3 September 14

Page 17: Beyond VoiceOver: making iOS apps accessible

How is an iOS device used by someone

with limited vision?

Wednesday, 3 September 14

Page 18: Beyond VoiceOver: making iOS apps accessible

VoiceOver

Wednesday, 3 September 14

Page 19: Beyond VoiceOver: making iOS apps accessible

VoiceOver replicates the UI for users who

can’t see it.

Wednesday, 3 September 14

Page 20: Beyond VoiceOver: making iOS apps accessible

Wednesday, 3 September 14

Page 21: Beyond VoiceOver: making iOS apps accessible

VoiceOver speaks 36 languages

Wednesday, 3 September 14

Page 22: Beyond VoiceOver: making iOS apps accessible

Available on iOS & OS X

Wednesday, 3 September 14

Page 23: Beyond VoiceOver: making iOS apps accessible

To extend VoiceOver, users can also use braille.

Wednesday, 3 September 14

Page 24: Beyond VoiceOver: making iOS apps accessible

Braille displaysWednesday, 3 September 14

Page 25: Beyond VoiceOver: making iOS apps accessible

Braille Keyboards

Wednesday, 3 September 14

Page 26: Beyond VoiceOver: making iOS apps accessible

That’s pretty amazing!

Wednesday, 3 September 14

Page 27: Beyond VoiceOver: making iOS apps accessible

Demo

Wednesday, 3 September 14

Page 28: Beyond VoiceOver: making iOS apps accessible

Basics of the Accessibility APIs

Wednesday, 3 September 14

Page 29: Beyond VoiceOver: making iOS apps accessible

isAccessibilityElement

sendButton.isAccessibliltyElement = YES;

Wednesday, 3 September 14

Page 30: Beyond VoiceOver: making iOS apps accessible

accessibilityLabel- Label that identifies the accessibility element- UIKit control: uses title- Image-based controls definitely need to specify this!- Don’t include the control type

“Play”

Wednesday, 3 September 14

Page 31: Beyond VoiceOver: making iOS apps accessible

accessibilityTraits- Combination of traits that best characterise the accessibility element- UIKit controls: defaults to standard traits- Combine traits with an OR operator

- (UIAccessibilityTraits)accessibilityTraits{ return [super accessibilityTraits] | UIAccessibilityTraitButton;}

Wednesday, 3 September 14

Page 32: Beyond VoiceOver: making iOS apps accessible

accessibilityValue - Used when a element has a dynamic value

Wednesday, 3 September 14

Page 33: Beyond VoiceOver: making iOS apps accessible

accessibilityHint

- Describes the outcome of performing an action- Don’t make it sound like a command- Start with verb describing result- Keep it briefNote: can be disabled by user

“Plays the song”

Wednesday, 3 September 14

Page 34: Beyond VoiceOver: making iOS apps accessible

accessibilityHint

- Describes the outcome of performing an action- Don’t make it sound like a command- Start with verb describing result- Keep it briefNote: can be disabled by user

Wednesday, 3 September 14

Page 35: Beyond VoiceOver: making iOS apps accessible

Adding support to a Xib or Storyboard

Wednesday, 3 September 14

Page 36: Beyond VoiceOver: making iOS apps accessible

- Enable accessibility- Fill out Label and Hint- Add traits

Wednesday, 3 September 14

Page 37: Beyond VoiceOver: making iOS apps accessible

Adding support programmatically

Wednesday, 3 September 14

Page 38: Beyond VoiceOver: making iOS apps accessible

Simple example of adding support

UIButton *sendButton = [UIButton buttonWithStyle...];

[sendButton setAccessibilityLabel:@”Send”];[sendButton setAccessibilityHint:@”Sends message”];

UISwitch *visibleSwitch = [UISwitch new];NSString *switchValue = [visibleSwitch isOn]?@”Visible”:@”Invisible”;[visibleSwitch setAccessibilityValue:switchValue];

MyCustomControl *myControl = [MyCustomControl new];

[myControl setAccessibilityTraits:[super accessibilityTraits] | UIAccessbilityTraitButton]; //Bitwise OR traits together

Wednesday, 3 September 14

Page 39: Beyond VoiceOver: making iOS apps accessible

This is great if your app is really basic...

Wednesday, 3 September 14

Page 40: Beyond VoiceOver: making iOS apps accessible

...but apps have moved beyond the

basics.

Wednesday, 3 September 14

Page 41: Beyond VoiceOver: making iOS apps accessible

Find out if user has VoiceOver on

BOOL isVoiceOverOn = UIAccessiblityIsVoiceOverRunning():

Wednesday, 3 September 14

Page 42: Beyond VoiceOver: making iOS apps accessible

Moving VoiceOver focus

UIAccessibilityPostNotification(UIAccessibilityScreenChangedNotification, self.goButton);

Wednesday, 3 September 14

Page 43: Beyond VoiceOver: making iOS apps accessible

UIAccessibilityCustomAction

UIAccessibilityCustomAction *trashAction = [[UIAccessibilityCustomAction alloc] initWithName:@"Trash" target:self selector:@selector(trashMessage)];

UIAccessibilityCustomAction *moreAction = [[UIAccessibilityCustomAction alloc] initWithName:@"More" target:self selector:@selector(moreOptions)];

UIAccessibilityCustomAction *activateAction = [[UIAccessibilityCustomAction alloc] initWithName:@"Activate" target:self selector:@selector(activate)];

cell.accessibilityCustomActions = @[trashAction, moreAction, activateAction];

You can add multiple actions to an element.

Wednesday, 3 September 14

Page 44: Beyond VoiceOver: making iOS apps accessible

UIAccessibilityContainer

@property (nonatomic, strong) NSArray *accessibilityElements;

Specify the order VoiceOver should go through the elements.

self.accessibilityElements = @[self.imageView, self.headlineLabel, self.summaryLabel, self.twitterButton, self.facebookButton, self.emailButton];

Wednesday, 3 September 14

Page 45: Beyond VoiceOver: making iOS apps accessible

- (BOOL)accessibilityActivate;

-This gets called when a user double-taps.-Good for elements where a gesture is used to normally activate it.

Return YES or NO depending on success.

Wednesday, 3 September 14

Page 46: Beyond VoiceOver: making iOS apps accessible

Direct Interaction

- (UIAccessibilityTraits)accessibilityTraits { return UIAccessibilityTraitAllowsDirectInteraction;}

Wednesday, 3 September 14

Page 47: Beyond VoiceOver: making iOS apps accessible

Accessibility notifications

UIAccessibilityPostNotification(NAME, PARAMETER);

(UIAccessibilityPageScrolledNotification, @”Top of list”)(UIAccessibilityAnnouncementNotification, @”New message”)(UIAccessbilityLayoutChangedNotification, NSString or UIView)etc...

Wednesday, 3 September 14

Page 48: Beyond VoiceOver: making iOS apps accessible

Magic TapTwo-finger double-tap

- (BOOL)accessibilityPerformMagicTap {[self doAwesomeThing];

return YES;}

Wednesday, 3 September 14

Page 49: Beyond VoiceOver: making iOS apps accessible

Getting backtwo-finger, scrub back and forth

- (BOOL)accessibilityPerformEscape {// Dismiss your viewreturn YES;

}

Wednesday, 3 September 14

Page 50: Beyond VoiceOver: making iOS apps accessible

Not using UIKit?

Wednesday, 3 September 14

Page 51: Beyond VoiceOver: making iOS apps accessible

It’s still possible!

Wednesday, 3 September 14

Page 52: Beyond VoiceOver: making iOS apps accessible

Implement UIAccessibilityContainer

protocol

CustomContentAccessibility sample code from WWDC 2013

Wednesday, 3 September 14

Page 53: Beyond VoiceOver: making iOS apps accessible

Testing VoiceOver

Wednesday, 3 September 14

Page 54: Beyond VoiceOver: making iOS apps accessible

Have a plan

Wednesday, 3 September 14

Page 55: Beyond VoiceOver: making iOS apps accessible

Test plansUser StoriesUse Cases

Requirements

Wednesday, 3 September 14

Page 56: Beyond VoiceOver: making iOS apps accessible

The simulator

Wednesday, 3 September 14

Page 57: Beyond VoiceOver: making iOS apps accessible

Accessibility Inspector

Wednesday, 3 September 14

Page 58: Beyond VoiceOver: making iOS apps accessible

On a device

Wednesday, 3 September 14

Page 59: Beyond VoiceOver: making iOS apps accessible

Accessibility shortcutTriple-tap the home button

Wednesday, 3 September 14

Page 60: Beyond VoiceOver: making iOS apps accessible

Siri - turn VoiceOver on

Wednesday, 3 September 14

Page 61: Beyond VoiceOver: making iOS apps accessible

Screen curtainThree-finger triple-tap on the screen

Wednesday, 3 September 14

Page 62: Beyond VoiceOver: making iOS apps accessible

User testing

- @AppleVis (http://www.applevis.com)- WWDC labs- Charities and local councils- Support groups

Wednesday, 3 September 14

Page 63: Beyond VoiceOver: making iOS apps accessible

Physical / Motor skills

Wednesday, 3 September 14

Page 64: Beyond VoiceOver: making iOS apps accessible

Wednesday, 3 September 14

Page 65: Beyond VoiceOver: making iOS apps accessible

How does a person with limited physical/motor skills use iOS?

Wednesday, 3 September 14

Page 66: Beyond VoiceOver: making iOS apps accessible

Assistive Touch

Wednesday, 3 September 14

Page 67: Beyond VoiceOver: making iOS apps accessible

Switch Control

Wednesday, 3 September 14

Page 68: Beyond VoiceOver: making iOS apps accessible

Wednesday, 3 September 14

Page 69: Beyond VoiceOver: making iOS apps accessible

Setting up Switch Control

Wednesday, 3 September 14

Page 70: Beyond VoiceOver: making iOS apps accessible

Wednesday, 3 September 14

Page 71: Beyond VoiceOver: making iOS apps accessible

Adding support

Wednesday, 3 September 14

Page 72: Beyond VoiceOver: making iOS apps accessible

Switch Control finds elements that have

actionable behaviour.

Wednesday, 3 September 14

Page 73: Beyond VoiceOver: making iOS apps accessible

Basically, if you’ve added support through

UIAccessibility APIs then it should work.

Wednesday, 3 September 14

Page 74: Beyond VoiceOver: making iOS apps accessible

Testing Switch Control

Wednesday, 3 September 14

Page 75: Beyond VoiceOver: making iOS apps accessible

On a device

Wednesday, 3 September 14

Page 76: Beyond VoiceOver: making iOS apps accessible

User testing

Wednesday, 3 September 14

Page 77: Beyond VoiceOver: making iOS apps accessible

Learning Difficulties

Wednesday, 3 September 14

Page 78: Beyond VoiceOver: making iOS apps accessible

How does someone with learning

difficulties use an iOS device?

Wednesday, 3 September 14

Page 79: Beyond VoiceOver: making iOS apps accessible

Guided Access

Wednesday, 3 September 14

Page 80: Beyond VoiceOver: making iOS apps accessible

How does Guided Access work?

Wednesday, 3 September 14

Page 81: Beyond VoiceOver: making iOS apps accessible

Adding support

UIGuidedAccessRestrictionDelegate

Wednesday, 3 September 14

Page 82: Beyond VoiceOver: making iOS apps accessible

New in iOS 8

Wednesday, 3 September 14

Page 83: Beyond VoiceOver: making iOS apps accessible

Visual Accommodations

BOOL UIAccessibilityIsBoldTextEnabled();

BOOL UIAccessibilityIsReduceTransparencyEnabled();

BOOL UIAccessibilityDarkerSystemColorsEnabled();

BOOL UIAccessibilityIsReduceMotionEnabled();

Wednesday, 3 September 14

Page 84: Beyond VoiceOver: making iOS apps accessible

Why should you add accessibility

support?

Wednesday, 3 September 14

Page 85: Beyond VoiceOver: making iOS apps accessible

Wednesday, 3 September 14

Page 86: Beyond VoiceOver: making iOS apps accessible

"When we work on making our devices

accessible by the blind, I don't consider the

bloody ROI." - Tim Cook

Wednesday, 3 September 14

Page 87: Beyond VoiceOver: making iOS apps accessible

More users.

Wednesday, 3 September 14

Page 88: Beyond VoiceOver: making iOS apps accessible

Accessibility is for everyone.

Wednesday, 3 September 14

Page 89: Beyond VoiceOver: making iOS apps accessible

Craftsmanship.

Wednesday, 3 September 14

Page 90: Beyond VoiceOver: making iOS apps accessible

It’s it the most amazing thing

you can do as a developer.

Wednesday, 3 September 14

Page 91: Beyond VoiceOver: making iOS apps accessible

How many apps are accessible?

Wednesday, 3 September 14

Page 92: Beyond VoiceOver: making iOS apps accessible

This slide intentionally left

blank

Wednesday, 3 September 14

Page 93: Beyond VoiceOver: making iOS apps accessible

How can we improve this?

Wednesday, 3 September 14

Page 94: Beyond VoiceOver: making iOS apps accessible

Think about accessibility from the

start.

Wednesday, 3 September 14

Page 95: Beyond VoiceOver: making iOS apps accessible

Don’t put accessibility in the backlog.

Wednesday, 3 September 14

Page 96: Beyond VoiceOver: making iOS apps accessible

If you have some open source code,

add accessibility support.

Wednesday, 3 September 14

Page 97: Beyond VoiceOver: making iOS apps accessible

If you use some open source code,

add support and do a pull request.

Wednesday, 3 September 14

Page 98: Beyond VoiceOver: making iOS apps accessible

Talk about it more.

Wednesday, 3 September 14

Page 99: Beyond VoiceOver: making iOS apps accessible

Get involved with charities / councils /

groups.

Wednesday, 3 September 14

Page 100: Beyond VoiceOver: making iOS apps accessible

There’s still a lot to do.

Wednesday, 3 September 14

Page 101: Beyond VoiceOver: making iOS apps accessible

What are some things you can do?

Wednesday, 3 September 14

Page 102: Beyond VoiceOver: making iOS apps accessible

Spend a whole day with VoiceOver or

Switch Control

Wednesday, 3 September 14

Page 103: Beyond VoiceOver: making iOS apps accessible

Take one weekend and do something with accessibility

Wednesday, 3 September 14

Page 104: Beyond VoiceOver: making iOS apps accessible

The Eyewriter

Wednesday, 3 September 14

Page 105: Beyond VoiceOver: making iOS apps accessible

The Eyewriter

Wednesday, 3 September 14

Page 106: Beyond VoiceOver: making iOS apps accessible

The Eyewriter

Wednesday, 3 September 14

Page 107: Beyond VoiceOver: making iOS apps accessible

Work with a charity to run a hackathon or

hack day

Wednesday, 3 September 14

Page 108: Beyond VoiceOver: making iOS apps accessible

As a developer, it’s up to you to make your app

accessible.Wednesday, 3 September 14

Page 109: Beyond VoiceOver: making iOS apps accessible

Facts

✓ It’s a lot of people ✓ It's simple✓ No app is too complicated to

be accessible✓ Testing is straightforward

Wednesday, 3 September 14

Page 110: Beyond VoiceOver: making iOS apps accessible

ResourcesTessting Accessibility on iOS:developer.apple.com/library/ios/technotes/TestingAccessibilityOfiOSApps

Sample code for non-UIKit:developer.apple.com/library/ios/samplecode/sc2216

Accessibility programming guide for iOS:developer.apple.com/library/ios/documentation/UserExperience/Conceptual/iPhoneAccessibility

Impairment Simulator Software:www.inclusivedesigntoolkit.com

Wednesday, 3 September 14

Page 111: Beyond VoiceOver: making iOS apps accessible

Thank you!

Sally Shepard // @mostgood

Wednesday, 3 September 14