Accessibility ์ž์ฒด๋งŒ ํ•ด๋„ ์ƒ๋‹นํžˆ ๋ฐฉ๋Œ€ํ•œ ๊ฐœ๋…์ด๋‹ค. ์ด๋ฒˆ์—๋Š” iOS ๊ฐœ๋ฐœ์ž๊ฐ€ ์‹ค์ œ๋กœ ๋งŽ์ด ์‚ฌ์šฉํ•˜๋Š” Accessibility์ธ Voice Over๋ฅผ UIKit์— ์ ์šฉํ•˜๋Š” ๋ฐฉ๋ฒ•์— ๋Œ€ํ•ด ์•Œ์•„๋ณด์ž.

VoiceOver

์‹œ๋ ฅ์ด ์ข‹์ง€ ์•Š์€ ๋ถ„๋“ค์ด ๊ธฐ๊ธฐ์˜ Interface๋ฅผ ๊ฒฝํ—˜ํ•  ์ˆ˜ ์žˆ๋„๋ก ํ•˜๋Š” ์Šคํฌ๋ฆฐ ๋ฆฌ๋”

์„ค์ • โ†’ ์†์‰ฌ์šด์‚ฌ์šฉ โ†’ VoiceOver์—์„œ ํ™œ์„ฑํ™” ๊ฐ€๋Šฅํ•˜๋‹ค. ์‹œ๋ฆฌ๋ฅผ ์‚ฌ์šฉํ•˜๋Š”๊ฒŒ ๋” ๋น ๋ฅด๋‹ค!

๋™์ž‘

  • Tap
    • ํ•ด๋‹น ํ•ญ๋ชฉ์ด ์–ด๋–ค ๋…€์„์ธ์ง€ ์„ ํƒํ•  ์ˆ˜ ์žˆ๋‹ค.
    • ์„ ํƒํ•˜๋ฉด ํ•ด๋‹น ํ•ญ๋ชฉ์— ๋Œ€ํ•œ ์ •๋ณด๋ฅผ ์ฝ์–ด์ค€๋‹ค.
  • Double Tap
    • ํ•ด๋‹น ํ•ญ๋ชฉ์˜ ๊ธฐ์กด Tap๊ธฐ๋Šฅ์ด ํ™œ์„ฑํ™” ๋œ๋‹ค.
    • ์ฆ‰ ํ„ฐ์น˜ํ–‰์œ„๋ฅผ ๋”๋ธ” ํƒญ์œผ๋กœ ์‚ฌ์šฉํ•  ์ˆ˜ ์žˆ๋‹ค.
  • Horizontal Swipe
    • ์˜ค๋ฅธ์ชฝ: ๋‹ค์Œ ํ•ญ๋ชฉ
    • ์™ผ์ชฝ: ์ด์ „ ํ•ญ๋ชฉ
  • Vertical Swipe
    • Voice over ๋กœํ„ฐ ๊ธฐ๋Šฅ์„ ์‚ฌ์šฉํ•  ์ˆ˜ ์žˆ๋‹ค.
    • ํ†ฑ๋‹ˆ ๋ฐ”ํ€ด ๋ชจ์–‘์œผ๋กœ ๊ธฐ์–ด๊ฐ€ ๋Œ์•„๊ฐ€๋ฉด์„œ ์˜ต์…˜์„ ์„ ํƒํ•  ์ˆ˜ ์žˆ๋‹ค.

VoiceOver ์ ์šฉ

iOS์—์„œ ๊ธฐ๋ณธ์ ์œผ๋กœ ์ œ๊ณตํ•˜๋Š” Component์˜ ๊ฒฝ์šฐ, ๊ธฐ๋ณธ ์ ‘๊ทผ์„ฑ์ด ์ œ๊ณต๋œ๋‹ค. ํ•˜์ง€๋งŒ ์šฐ๋ฆฌ๊ฐ€ ๋งŒ๋“œ๋Š” ๊ฒƒ์€ ๋ณต์žกํ•œ ์•ฑ์ด๊ธฐ ๋•Œ๋ฌธ์—, ์›ํ•˜๋Š” ๋™์ž‘์„ ํ•˜๊ธฐ ์œ„ํ•ด์„œ๋Š” ์–ด๋–ป๊ฒŒ ์„ค์ •ํ•˜๋Š”์ง€ ์•Œ๊ณ  ์žˆ์–ด์•ผ ํ•œ๋‹ค.

isAccessbilityElement

์ ‘๊ทผ์„ฑ ์š”์†Œ ๋งž๋‹ˆ..?

๊ธฐ๋ณธ๊ฐ’์€ false์ด์ง€๋งŒ, Control์˜ ๊ฒฝ์šฐ ๊ธฐ๋ณธ์ด true์ด๋‹ค. true๋กœ ์„ค์ •๋œ ๊ฒฝ์šฐ, ํ•ด๋‹น ์š”์†Œ์— ์ดˆ์ (์ปค์„œ)๋ฅผ ์ด๋™ํ•  ์ˆ˜ ์žˆ๋‹ค. ๋ถˆํ•„์š”ํ•œ ์š”์†Œ์ธ ๊ฒฝ์šฐ ์˜ต์…˜์„ ๊บผ ๋‚ด์šฉ์„ ์ฝ์ง€ ์•Š๋„๋ก ํ•œ๋‹ค.

let imageView = UIImageVIew()
imageView.isAccessbilityElement = false // ํ•ด๋‹น ์ด๋ฏธ์ง€ ์š”์†Œ์— ์ปค์„œ๊ฐ€ ๊ฐ€์ง€์•Š๋Š”๋‹ค.

accessibilityElementsHidden

๋‚ด ๋ฐ‘์˜ View๋“ค๋„ ๋‹ค accessibililty ๊บผ์ค˜!

ํ•ด๋‹น ์˜ต์…˜์„ ์ ์šฉํ•œ view์˜ subView๋“ค์˜ accessibility๋„ ๋ชจ๋‘ disable๋œ๋‹ค.

let someView = UIView()
someView.addSubview(UIView())
someView.accessibilityElementsHidden = true

accessibilityElements

ํ•˜์œ„ ๋ทฐ ์ค‘์— ๋„ˆํฌ๋“ค๋งŒ accessibility On์ด์•ผ!

์ถ”๊ฐ€์ ์ธ ํšจ๊ณผ๋Š” ์ด ๋ฐฐ์—ด์˜ ์ˆœ์„œ๋Œ€๋กœ ์ฝ์–ด์˜จ๋‹ค. ๊ฐ€๋” ๋‚ด๊ฐ€ ์›ํ•˜๋Š” ๋ฐฉ์‹๋Œ€๋กœ voiceover ํ˜ธ์ถœ์ด ์•ˆ๋˜๋Š” ๊ฒฝ์šฐ๊ฐ€ ์žˆ๋Š”๋ฐ, ํ•ด๋‹น ์˜ต์…˜์„ ์‚ฌ์šฉํ•˜๋ฉด ๋œ๋‹ค.

let someView = UIView()
let subview1 = UIView()
let subview2 = UIView()
let subview3 = UIView()
someView.addSubview(subview1)
someView.addSubview(subview2)
someView.addSubview(subview3)
someView.accessibilityElements = [subview1, subview2]

accessibilityLabel

์„ ํƒํ•˜๋ฉด ์–ด๋–ค ํ…์ŠคํŠธ๋ฅผ ์ฝ์–ด์ค„๊นŒ?

let deleteButton = UIButton()
deleteButton.setImage(UIImage(named: "delete", for: .normal))
deleteButton.accessbilityLabel = "์‚ญ์ œํ•˜๊ธฐ"

accessibilityHint

์ถ”๊ฐ€์ ์ธ ์ •๋ณด๋ฅผ ์ œ๊ณต, ์ฃผ๋กœ ์–ด๋–ป๊ฒŒ ๋™์ž‘ํ•˜๋Š”์ง€์— ๋Œ€ํ•œ ์„ค๋ช…์ด ๋“ค์–ด๊ฐ

let imageView = UIImageView()
imageView.accessibilityLabel = "์„ค๋‚  ์ด๋ฒคํŠธ"
imageView.accessibilityHint = "ํƒญํ•˜์—ฌ ์ดํ†ต"

accessibilityValue

Slider, TextField์™€ ๊ฐ™์ด ๊ฐ’์ด ๋ณ€๊ฒฝํ•˜๋Š” ์š”์†Œ์— ์‚ฌ์šฉ

let slider = UISlider()
slider.accessibilityLabel = "๋‹ค์šด๋กœ๋“œ ์ง„ํ–‰๋„"
slider.accessibilityValue = "50%"

accessbilityTraits

์š”์†Œ์˜ ํŠน์ง•์„ ์ง€์ •ํ•œ๋‹ค.

ํŠน์ง• ์ข…๋ฅ˜์—๋Š” .button, .image ๋“ฑ์ด ์žˆ๋‹ค. ์—†๋Š” ๊ฒฝ์šฐ .none์„ ์ž…๋ ฅํ•˜๋ฉด ๋œ๋‹ค.

let imageView = UIImageView()
imageView.accessibilityTraits = .image
 
let button = UIButton()
button.accessibilityTraits = .button
 
let view = UIView()
view.accessibilityTraits = .none

UIAccessibility Notification

์•ฑ ๋‚ด์— ๋ณ€๊ฒฝ์‚ฌํ•ญ์ด ์žˆ๋Š” ๊ฒฝ์šฐ Notification์„ ํ†ตํ•ด ์•Œ๋ฆผ์ด ์˜ด

let view = UIView()
// ๋ ˆ์ด์•„์›ƒ ๋ณ€๊ฒฝ ์•Œ๋ฆผ
 
UIAccessibility.post(
  notification: UIAccessibility.Notification.layoutChanged,
  argument: view
)

shouldGroupAccessibilityChildren

์Šคํฌ๋ฆฐ์˜ ์œ„์น˜์— ์ƒ๊ด€์—†์ด, ํ•ด๋‹น Element์— Focus๊ฐ€ ๋จผ์ €๊ฐ€๋„๋ก ํ•˜๋Š” Bool ๊ฐ’

  • Reading Order ์—ฌ๊ธฐ๋ฅผ ์ฐธ๊ณ ํ•˜์ž.

๊ธฐ๋ณธ์ ์œผ๋กœ Voiceover์˜ ์ดˆ์ ์€ ์™ผ์ชฝ ์ƒ๋‹จ์—์„œ ์˜ค๋ฅธ์ชฝ ํ•˜๋‹จ์œผ๋กœ ์ด๋™ํ•œ๋‹ค. ๊ทธ๋ ‡๊ธฐ ๋•Œ๋ฌธ์— ์ •๋ณด๊ฐ€ ์ˆ˜์ง์œผ๋กœ ๋‚˜์—ด๋˜์–ด ์žˆ์„ ๋•Œ ํ•˜์œ„๋กœ ์šฐ์„ ์ ์œผ๋กœ ์ฝ์–ด์ฃผ์–ด์•ผ ํ•œ๋‹ค๋ฉด ํ•ด๋‹น ์˜ต์…˜์„ ์‚ฌ์šฉํ•˜๋ฉด ๋˜๊ฒ ๋‹ค. ์˜ˆ๋ฅผ ๋“ค์–ด ํ•˜๋‚˜์˜ ์…€ ๋‚ด์˜ ๋‘๊ฐœ์˜ View๊ฐ€ ๊ฐ€๋กœ๋กœ ๋ฐฐ์น˜๋˜์–ด ์žˆ๋Š” ๊ฒฝ์šฐ ์™ผ์ชฝ ๋จผ์ € ์ •๋ณด๋ฅผ ์ฝ๊ณ , ์˜ค๋ฅธ์ชฝ์„ ์ฝ์–ด์•ผ ํ•  ๊ฒƒ์ด๋‹ค. ์ด๋Ÿฐ ๊ฒฝ์šฐ ์‚ฌ์šฉํ•˜๋ฉด ์ข‹๋‹ค!

Reference