- 보통 보이스오버만 생각하지만, 시각적으로도 대응해야 될 것이 있다.
- Color and Shapes
- 색맹이나 저시력자가 있기 때문에, 색만으로 특징을 주면 이들에게 어려움이 있을 수 있다.
- Button Shapes와 Color에 대한 구분이 필요한지 여부를 확인할 수 있는 accessibility 기능 추가
extension UIAccessibility {
@available(iOS 14.0, tvOS 14.0)
static var buttonShapesEnabled: Bool { get }
@available(iOS 14.0, tvOS 14.0)
static let buttonShapesEnabledStatusDidChangeNotification: NSNotification.Name
@available(iOS 13.0, tvOS 13.0)
static var shouldDifferentiateWithoutColor: Bool { get }
// 얘는 왜 String이냐
@available(iOS 13.0, tvOS 13.0)
static let differentiateWithoutColorDidChangeNotification: String
}
- Contrast는 인식에 중요한 역할을 한다.
- increase contrast 옵션을 쓰면 높은 대비를 가진 색으로 교체할 수 있다.
- 커스텀 컬러나 색상에 대해서도 이 옵션을 킬 수 있다.
- Smart Invert Color
- 시스템 UI의 색을 반전시켜서 어둡게 만든다.
- 이미지, 비디오, 앱 아이콘은 반전되지 않는다.
- UIView에는 이를 조절하기 위한 플래그가 제공된다.
- 다크모드가 제공되지 않는 앱에서도 사용이 가능하다는 점이 장점
extension UIView {
@available(iOS 11.0, tvOS 11.0)
var accessibilityIgnoresInvertColors: Bool { get set }
}
- Text Readability
- dynamic type에 대비해서 큰 텍스트를 염두에 두고 디자인하라
- 텍스트 잘리게 두지말고 label을 감싸라
- 심볼과 문자 모두 텍스트와 같이 스케일되어야 한다.
override func traitCollectionDidChange(_ previousTraitCollection: UITraitCollection?) {
if traitCollection.preferredContentSizeCategory < .accessibilityMedium) {
stackView.axis = .horizontal
stackView.alignment = .center
} else {
stackView.axis = .vertical
stackView.alignment = .leading
}
}
- Bold Text
- 강조하고 싶은 게 있으면 text Weight를 사용해서 구분하라.
- Bold Text 설정을 하면 유저가 텍스트에 집중할 수 있다.
- 가능하면 시스템 폰트를 써라 - 커스텀 폰트를 쓰면 이 변화에 수동으로 대응해야 한다.
extension UIAccessibility {
@available(iOS 9.0)
var isBoldTextEnabled: Bool { get }
@available(iOS 9.0)
static let boldTextStatusDidChangeNotification: NSNotification.Name
}
- Display preference
- 모션 감도
- 모션에 대한 멀미를 느끼는 사람을 위해서 모션을 줄이는 옵션
- 대기 애니메이션
- 패럴랙스 등의 모션 이펙트
- 자동 재생 비디오, gif 등
- 슬라이드 트랜지션
extension UIAccessibility {
@available(iOS 8.0, tvOS 9.0)
static var isReduceMotionEnabled: Bool { get }
@available(iOS 8.0, tvOS 9.0)
static let reduceMotionStatusDidChangeNotification: NSNotification.Name
}
- 크로스 페이드 모션 기능
- navigationController에서 푸시 동작을 크로스 페이드로 바꾸는 기능
- UINavigationController를 쓰면 따로 적용할 건 없다.
extension UIAccessibility {
@available(iOS 14.0, tvOS 14.0)
static var prefersCrossFadeTransitions: Bool { get }
@available(iOS 14.0, tvOS 14.0)
static let perfersCrossFadeTransitionsStatusDidChange: NSNotification.Name
}
- 투명도 감소
- Blur effect를 완전히 불투명하게 만들어주는 기능
- 텍스트의 가독성을 높이는 기능
- 시스템의 Blur Effect를 쓰면 따로 해줄 건 없다.
extension UIAccessibility {
@available(iOS 8.0, tvOS 9.0)
static var isReduceTransparencyEnabled: Bool { get }
@available(iOS 8.0, tvOS 9.0)
static let reduceTransparencyStatucDidChangeNotification: NSSNotification.Name
}