Skip to content

Commit

Permalink
Restore resources
Browse files Browse the repository at this point in the history
  • Loading branch information
akaDuality committed Feb 11, 2024
1 parent 6eba90f commit 7dda699
Show file tree
Hide file tree
Showing 17 changed files with 186 additions and 72 deletions.
Original file line number Diff line number Diff line change
Expand Up @@ -2,92 +2,89 @@
@Intro(title: "Setting Up Adjustable Elements") {
Simplifies interactions with complex elements for VoiceOver.
}

@Comment {

@Section(title: "Basic Setup") {
@ContentAndMedia {
By default any element can contain ``Book/accessibilityValue`` to expose *additional data* to user. Some elements come complicated and may contain a *dynamic value* controlled by a vertical swipe. Here some examples:
@Section(title: "Basic Setup") {
@ContentAndMedia {
By default any element can contain ``Book/accessibilityValue`` to expose *additional data* to user. Some elements come complicated and may contain a *dynamic value* controlled by a vertical swipe. Here some examples:
}

@Steps {
@Step {
Accessible element can be marked by ``UIAccessibilityTraits_/adjustable`` trait to make ``Book/accessibilityValue`` dynamic.

@Code(name: "", file: "AdjustableTutorialStep_1.swift")
}

@Steps {
@Step {
Accessible element can be marked by ``UIAccessibilityTraits_/adjustable`` trait to make ``Book/accessibilityValue`` dynamic.

@Code(name: "", file: "AdjustableTutorialStep_1.swift")
}
@Step {
Accessible element can be marked by ``UIAccessibilityTraits_/adjustable`` trait to make ``Book/accessibilityValue`` dynamic.

@Step {
Accessible element can be marked by ``UIAccessibilityTraits_/adjustable`` trait to make ``Book/accessibilityValue`` dynamic.
@Code(name: "", file: "AdjustableTutorialStep_2.swift")
}
@Code(name: "", file: "AdjustableTutorialStep_2.swift")
}

@Step {`
As a result the element will react on a vertical swipe by calling ``Book/accessibilityIncrement()`` and ``Book/accessibilityDecrement()``.

@Step {`
As a result the element will react on a vertical swipe by calling ``Book/accessibilityIncrement()`` and ``Book/accessibilityDecrement()``.

After each swipe the ``Book/accessibilityValue`` getter will be read again and the next value will be vocalised.

> Note: `AccessibilityLabel wouldn't be read again after swipe`

@Code(name: "", file: "AdjustableTutorialStep_3.swift")
}
After each swipe the ``Book/accessibilityValue`` getter will be read again and the next value will be vocalised.

> Note: `AccessibilityLabel wouldn't be read again after swipe`

@Code(name: "", file: "AdjustableTutorialStep_3.swift")
}
}

@Section(title: "Backward Compatibility") {
@ContentAndMedia {
Voice Control and Switch Control work with separate *buttons* instead of *adjustable elements*.
}
}

@Section(title: "Backward Compatibility") {
@ContentAndMedia {
Voice Control and Switch Control work with separate *buttons* instead of *adjustable elements*.
}

@Steps {
@Step {
> Important: Adjustable elements are only used for VoiceOver and will break the behaviour of Voice Control and Switch Control.

Distinguish their behaviour in code by a dynamic getter:

@Code(name: "", file: "AdjustableTutorialStep_4.swift")
}
@Steps {
@Step {
> Important: Adjustable elements are only used for VoiceOver and will break the behaviour of Voice Control and Switch Control.

@Step {
Switch Control requires grouping: firstly focus will be placed on the group itself, afterwards the selection will be moved between elements of this group. It simulates navigation by reducing the number of elements on each level.

> Note: Watch video [How Grouping Simplifies Navigation](https://youtube.com/shorts/1l8H615EkV0?si=tKyhIGjBbR9XG9HP)

@Code(name: "", file: "AdjustableTutorialStep_5.swift")
}
Distinguish their behaviour in code by a dynamic getter:

@Code(name: "", file: "AdjustableTutorialStep_4.swift")
}

@Step {
Switch Control requires grouping: firstly focus will be placed on the group itself, afterwards the selection will be moved between elements of this group. It simulates navigation by reducing the number of elements on each level.

> Note: Watch video [How Grouping Simplifies Navigation](https://youtube.com/shorts/1l8H615EkV0?si=tKyhIGjBbR9XG9HP)

@Code(name: "", file: "AdjustableTutorialStep_5.swift")
}
}

@Assessments {
@MultipleChoice {
What **Accessibility Features** use adjustable trait?
}

@Assessments {
@MultipleChoice {
What **Accessibility Features** use adjustable trait?

@Choice(isCorrect: false) {
Switch Control


@Choice(isCorrect: false) {
Switch Control


@Justification(reaction: "Try again!") {
Switch Control indeed requires grouping to simplify navigation, but uses ``Book/accessibilityNavigationStyle`` for that.
}
@Justification(reaction: "Try again!") {
Switch Control indeed requires grouping to simplify navigation, but uses ``Book/accessibilityNavigationStyle`` for that.
}
@Choice(isCorrect: true) {
VoiceOver
@Justification(reaction: "That's right!") {
Blind people would like to have a reduced number of elements on the screen and simplified interactions by vertical swipes to adjust the value of the element.
}
}
@Choice(isCorrect: true) {
VoiceOver

@Justification(reaction: "That's right!") {
Blind people would like to have a reduced number of elements on the screen and simplified interactions by vertical swipes to adjust the value of the element.
}
}

@Choice(isCorrect: false) {
Voice Control


@Choice(isCorrect: false) {
Voice Control


@Justification(reaction: "Try again!") {
Voice Control is mostly used by people who are able to see. In such case percieving elements as separate buttons is preferred.
}
@Justification(reaction: "Try again!") {
Voice Control is mostly used by people who are able to see. In such case percieving elements as separate buttons is preferred.
}
}
}
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -53,7 +53,8 @@ The resources are provided by **Mikhail Rubanov**, Head of Mobile Development at

### VoiceOver Designer
Reading the book you may sometimes notice screenshots of iOS applications with *mark-ups* related to accessibility design over them. This is [VoiceOver Designer](https://rubanov.dev/voice-over-designer), an [open-source](https://github.com/VODGroup/VoiceOverDesigner) macOS application that allows to design *accessibility scenarios* over a screenshot of an app.
![Screenshot of VoiceOver Designer](https://rubanov.dev/voice-over-designer/images/HeaderLight.png)
![Screenshot of VoiceOver Designer](VoiceOverDesigner.png)



## Topics
Expand Down
Original file line number Diff line number Diff line change
@@ -0,0 +1,6 @@
import UIKit

class AccessibleStepper: UIStepper {

private func counterValue = 0
}
Original file line number Diff line number Diff line change
@@ -0,0 +1,18 @@
import UIKit

class AccessibleStepper: UIStepper {

private func counterValue = 0

var isAccessibilityElement: Bool {
true
}

var accessibilityLabel: String {
"Number of products"
}

var accessibilityValue: String {
"\(counterValue)"
}
}
Original file line number Diff line number Diff line change
@@ -0,0 +1,30 @@
import UIKit

class AccessibleStepper: UIStepper {

private func counterValue = 0

var isAccessibilityElement: Bool {
true
}

var accessibilityLabel: String {
"Number of products"
}

var accessibilityValue: String {
"\(counterValue)"
}

var accessibilityTraits: [UIAccessibilityTraits] {
.adjustable
}

func accessibilityIncrement() {
counterValue += 1
}

func accessibilityDecrement() {
counterValue -= 1
}
}
Original file line number Diff line number Diff line change
@@ -0,0 +1,30 @@
import UIKit

class AccessibleStepper: UIStepper {

private func counterValue = 0

var isAccessibilityElement: Bool {
UIAccessibility.isVoiceOverRunning
}

var accessibilityLabel: String {
"Number of products"
}

var accessibilityValue: String {
"\(counterValue)"
}

var accessibilityTraits: [UIAccessibilityTraits] {
UIAccessibility.isVoiceOverRunning ? .adjustable : .none
}

func accessibilityIncrement() {
counterValue += 1
}

func accessibilityDecrement() {
counterValue -= 1
}
}
Original file line number Diff line number Diff line change
@@ -0,0 +1,32 @@
import UIKit

class AccessibleStepper: UIStepper {

private func counterValue = 0

var isAccessibilityElement: Bool {
UIAccessibility.isVoiceOverRunning
}

var accessibilityLabel: String {
"Number of products"
}

var accessibilityValue: String {
"\(counterValue)"
}

var accessibilityTraits: [UIAccessibilityTraits] {
UIAccessibility.isVoiceOverRunning ? .adjustable : .none
}

func accessibilityIncrement() {
counterValue += 1
}

func accessibilityDecrement() {
counterValue -= 1
}

var accessibilityNavigationStyle = .combined
}
Loading
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
Loading
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
Loading
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
Loading
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
Loading
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
Loading
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
Loading
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
Loading
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
Loading
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
Loading
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.

0 comments on commit 7dda699

Please sign in to comment.