learnings for accessibility for ios platform

22
people Learnings for Accessibility Tasneem Sayeed June 6, 2013

Upload: tasneem-sayeed

Post on 22-Nov-2014

1.467 views

Category:

Technology


4 download

DESCRIPTION

This presentation provides an overview on what it means to make an app accessible for the iOS platform. It provides guidelines for making your iOS app accessible and includes an overview on the most common accessible attributes, traits and how to add Accessibility via interface builder as well as in code. It covers Accessibility Notifications, Voiceover specific API, Accessibility Containers, and some of the best practices for Accessibility.

TRANSCRIPT

Page 1: Learnings for Accessibility for iOS Platform

people

Learnings for AccessibilityTasneem Sayeed

June 6, 2013

Page 2: Learnings for Accessibility for iOS Platform

Agenda• Accessibility–What it means for an iOS developer– How do I make my app accessible

• Accessibility Attributes & Traits• Adding Accessibility – via Interface Builder– In Code

• Accessibility Notifications• VoiceOver specific API• Scrollable Elements• Accessibility Containers• Best Practices for Accessibility• Summary

Page 3: Learnings for Accessibility for iOS Platform

• Making Your App Accessible– The iOS Human Interface Guidelines provide detailed instructions

on how to create an intuitive interface that enables users with disabilities to accomplish tasks quickly and efficiently, while maintaining the consistency and ease of learning that characterizes successful iOS apps. – Developers that use standard controls and their subclasses will

find that support for accessibility is built-in. Apple’s Accessibility APIs define how iOS apps can make their user interface available to an external assistive app or service.

Accessibility in iOS

Page 4: Learnings for Accessibility for iOS Platform

• How it Works– VoiceOver interacts with objects in your app to allow people with

disabilities to drive the user interface in an alternative manner. For example, a VoiceOver user relies solely on an alternative set of gestures for control, and on speech synthesis or braille for feedback. – VoiceOver intercepts all the gestures on the screen - Settings => General =>Accessibility=>VoiceOver=>On - One Click or Touch => Focus - Double-Click => Activates - Three Fingers => Replaces one finger swipe - One Finger Swipe => Replaces Tab Key - Triple Click Home => Quick way to turn on/off VoiceOver

Accessibility in iOS

Page 5: Learnings for Accessibility for iOS Platform

Accessibility • Accessibility API introduced in iOS 3.0

• An accessibility interface– Allows another process to • Access individual items in the UI•Query for status and description• Perform actions and events

• The remote process is an Assistive Technology (i.e. VoiceOver)

Page 6: Learnings for Accessibility for iOS Platform

Accessibility Attributes Common Accessibility Attributes

Page 7: Learnings for Accessibility for iOS Platform

Accessibility Traits• Accessibility Traits– Tell an assistive application how an accessibility element behaves

or should be treated.• UIAccessibilityTraits– A mask that contains the OR combination of the accessibility traits

that best characterize an accessibility element.

Page 8: Learnings for Accessibility for iOS Platform

Other Accessibility Attributes

Page 9: Learnings for Accessibility for iOS Platform

Adding Accessibility with Interface Builder

• Changing Simple Accessibility values– accessibilityLabel– isAccessibilityElement– accessibilityHint– accessibilityTraits

Page 10: Learnings for Accessibility for iOS Platform

Adding Accessibility in Code

• If Accessibility values change

Page 11: Learnings for Accessibility for iOS Platform

Accessibility Notifications• Notifications– Tell VoiceOver something has happened

• 2 types of Accessibility Notifications– Those which your app can post.• You post accessibility notifications with UIAccessibilityPostNotification and observe with the default notification center.

– And those which your app can observe. • The observable accessibility notifications are posted by UIKit when something in the app’s environment changes, such as when an accessibility setting is toggled, or when the layout of a screen changes.

Page 12: Learnings for Accessibility for iOS Platform

Accessibility Notifications• Screen changes: when your UI changes dramatically. – Usually when a user moves into a different part of your app

(navigates to a different screen). UIAccessibilityPostNotification(UIAccessibilityScreenChangedNotification, nil);

• Layout changes: if some part of your UI changes, but the user hasn’t necessarily jumped to an entirely different part of your app. – This notification tells VoiceOver to re-read the current state of all

accessible items that are on-screen, and by doing this it figures out what has changed and informs the user of those changes.

UIAccessibilityPostNotification(UIAccessibilityLayoutChangedNotification, nil);

• Dynamic changes: if a part of your user interface is dealing with some dynamically changing information (state changes, data changes, etc.). This notification tells VoiceOver to read it out to the user.

• UIAccessibilityPostNotification(UIAccessibilityAnnouncementNotification, @”Loading complete.”);

Page 13: Learnings for Accessibility for iOS Platform

VoiceOver-specific API• VoiceOver-specific API– Sometimes it is useful to determine whether or not VoiceOver is running, and

to do different things depending on whether it is or not.– A program can, at any time, test to see whether VoiceOver is

enabled or not.

Page 14: Learnings for Accessibility for iOS Platform

VoiceOver-specific API• VoiceOver-specific API– Track where focus is

Page 15: Learnings for Accessibility for iOS Platform

Accessibility Actions for Scrollable Elements• Scrollable Elements

– Implement this method if a view in the view hierarchy supports a scroll by page action.

Page 16: Learnings for Accessibility for iOS Platform

Accessibility Containers

• Used for custom views with multiple containers

• Returns Accessibility “sub-elements”– Ex. MonthView: UIView

• Creating an Accessibility Sub-element (fake element)– Make a UIAccessibilityElement•Wraps all important data about an object and sends it over to VoiceOver

Page 17: Learnings for Accessibility for iOS Platform

Accessibility Containers• Make the Contents of Custom Container Views Accessible– If your application displays a custom view that contains other elements with

which users interact, you need to make the contained elements separately accessible.

– Need to make sure that the container view itself is not accessible. The reason is that users interact with the contents of the container, not with the container itself.

– Custom container view should implement the UIAccessibilityContainer protocol. • This protocol defines methods that make the contained elements available in an array.

– The following container view creates the array of accessible elements only when methods of the UIAccessibilityContainer protocol are called. As a result, if iPhone accessibility is not currently active, the array is not created.

Page 18: Learnings for Accessibility for iOS Platform

Accessibility Containers

Page 19: Learnings for Accessibility for iOS Platform

Accessibility Containers

Page 20: Learnings for Accessibility for iOS Platform

Best Practices for Accessibility• Use short concise labels– Good: “Add city”– Bad: “Add a city to the list of cities”

• Don’t include the type information in the label– Good: “Remove City”– Bad: “Remove City button”

• Use localized strings for labels and hints– Good: VoiceOver works in over 30 languages– Localize number and localize dates• Use NSNumberFormatter

• With custom table view cells–Only need to add accessibilityLabel– If there are multiple strings, concatenate with commas

Page 21: Learnings for Accessibility for iOS Platform

Summary• What is Accessibility?–What it means for an iOS developer– How do I make my apps accessible?

• Common Accessibility Attributes & Traits• Adding Accessibility – Interface Builder– In Code

• Accessibility Notifications• VoiceOver specific API• Scrollable Elements• Accessibility Containers• Best Practices for Accessibility

Page 22: Learnings for Accessibility for iOS Platform

Resources

– Accessibility Programming Guide for iOS http://developer.apple.com/library/ios/#documentation/UserExperience/Conceptual/iPhoneAccessibility/Introduction/Introduction.html

– UIAccessibility Protocol Reference http://developer.application.com for UIAccessibility– VoiceOver User Manual http://support.apple.com/manuals/iPhone/– The Librarian: Accessibility on iOS: Make an App for Everyone

http://yaccessibilityblog.com/wp/librarian-accessibility-ios.html– Mobile Accessiblity (posted on Oct 8, 2012 by Ted)

http://www.last-child.com/mobile-accessibility