Dimitri James Tsiflitzis
CocoaHeads SKG #39 - Stars and shadows ain’t good to see by
Everyone uses smartphone apps, including people with disabilities. Building accessible apps helps them use them.
So let's:
Some stats curtesy of the World Bank:
Unfortunately for everyone, accessibility, is always at the bottom, or not even in, the priority list. Why is that?
Access voice over on demand with a power button triple-tap.
Use Xcode's built-in Accessibility Inspector.
Xcode > Open Developer Tool > Accessibility Inspector.
Image: https://www.scaledrone.com/blog/ios-accessibility-tutorial-tips-on-making-your-app-more-accessible/
cell.accessibilityTraits |= UIAccessibilityTraitButton
cell.isAccessibilityElement = false
cell.contentView.subviews.forEach { $0.isAccessibilityElement = true }
tl;dr Ensuring every UI element has a label, hint and trait is a pretty good start.
Users can set a system-wide preferred font size for all apps.
// headline
textView.font = UIFont.preferredFont(forTextStyle: UIFont.TextStyle.headline)
// subheadline
textView.font = UIFont.preferredFont(forTextStyle: UIFont.TextStyle.subheadline)
// body
textView.font = UIFont.preferredFont(forTextStyle: UIFont.TextStyle.body)
// footnote
textView.font = UIFont.preferredFont(forTextStyle: UIFont.TextStyle.footnote)
// caption 1
textView.font = UIFont.preferredFont(forTextStyle: UIFont.TextStyle.caption1)
// caption 2
textView.font = UIFont.preferredFont(forTextStyle: UIFont.TextStyle.caption2)
💡Use NotificationCenter to subscribe to the UIContentSizeCategoryDidChange to refresh your user interface if you receive it.
Button(action: {},
label: { Text("➡️✉️") })
.accessibility(label: Text("Send"))
Slider(value: $sliderValue, in: minimumValue…maximumvalue)
.accessibility(value: Text(""\(Int(sliderValue)) out of 10"))
Button(action: {}, label: { Text(“➡️✉️”) })
.accessibility(hint: Text(“Sends your message.”))
Dimitri James Tsiflitzis