Skip to content

Commit

Permalink
no pinetrees and old structure ghosts
Browse files Browse the repository at this point in the history
  • Loading branch information
crescentheaded committed Feb 10, 2024
1 parent 348c61d commit f05eb68
Show file tree
Hide file tree
Showing 7 changed files with 420 additions and 417 deletions.
Original file line number Diff line number Diff line change
Expand Up @@ -90,9 +90,6 @@
@TutorialReference(tutorial: "doc:HowTextInputWorks")
@TutorialReference(tutorial: "doc:HandleErrorsInTextField")
}
}

@Volume(name: "Visual properties") {

@Chapter(name: "Colors And Shapes") {
@Image(source: chapter-placeholder.png, alt: "")
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -3,88 +3,91 @@
Simplifies interactions with complex elements for VoiceOver.
}

@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:
}
@Comment {

@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.

@Code(name: "", file: "AdjustableTutorialStep_2.swift")
@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:
}

@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.
@Steps {
@Step {
Accessible element can be marked by ``UIAccessibilityTraits_/adjustable`` trait to make ``Book/accessibilityValue`` dynamic.

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

> Note: `AccessibilityLabel wouldn't be read again after swipe`
@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_3.swift")
@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")
}
}
}
}

@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")

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

@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)

@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")
}

@Code(name: "", file: "AdjustableTutorialStep_5.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?

@Choice(isCorrect: false) {
Switch Control


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

@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: false) {
Switch Control


@Justification(reaction: "Try again!") {
Switch Control indeed requires grouping to simplify navigation, but uses ``Book/accessibilityNavigationStyle`` for that.
}
}
}

@Choice(isCorrect: true) {
VoiceOver

@Choice(isCorrect: false) {
Voice Control


@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.
}
}

@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.
@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.
}
}
}
}
Expand Down
Original file line number Diff line number Diff line change
@@ -1,64 +1,65 @@
# Adjustable Elements

Simplifies interactions with complex elements for VoiceOver.

> Tip:
> - Best for VoiceOver, is changed by vertical swipe
> - Avoid at Voice Control
> - Replace by ``Book/accessibilityNavigationStyle`` for Switch Control
@Comment {
Simplifies interactions with complex elements for VoiceOver.

## Overview
> Tip:
> - Best for VoiceOver, is changed by vertical swipe
> - Avoid at Voice Control
> - Replace by ``Book/accessibilityNavigationStyle`` for Switch Control

By default any element can contain ``UIAccessibilityTraits_/adjustable`` trait to expose additional data for user. Some elements come complicated and can contain dynamic value, controlled by vertical swipe. Examples:
- Slider
- Stepper
- Any horizontal carousel
## Overview

> Note: After vertical swipe reads only the new value, a label is omitted to avoid repeatness.
By default any element can contain ``UIAccessibilityTraits_/adjustable`` trait to expose additional data for user. Some elements come complicated and can contain dynamic value, controlled by vertical swipe. Examples:
- Slider
- Stepper
- Any horizontal carousel

Tutorial <doc:AdjustableTutorial> for detailed explanation.
> Note: After vertical swipe reads only the new value, a label is omitted to avoid repeatness.

### How to setup
Tutorial <doc:AdjustableTutorial> for detailed explanation.

- Accessible element can be marked by ``UIAccessibilityTraits_/adjustable`` trait to make ``Book/accessibilityValue`` dynamic.
- As a result the element will react on vertical swipe by calling ``Book/accessibilityIncrement()`` and ``Book/accessibilityDecrement()``.
- After each swipe the ``Book/accessibilityValue`` getter will be reread and the new value will be spoken out.
### How to setup

### Enable adjustable only for VoiceOver
- Accessible element can be marked by ``UIAccessibilityTraits_/adjustable`` trait to make ``Book/accessibilityValue`` dynamic.
- As a result the element will react on vertical swipe by calling ``Book/accessibilityIncrement()`` and ``Book/accessibilityDecrement()``.
- After each swipe the ``Book/accessibilityValue`` getter will be reread and the new value will be spoken out.

> Important: Adjustable elements is useful only for VoiceOver and will brake behaviour for Voice Control and Switch Control.
### Enable adjustable only for VoiceOver

Distinguish behaviour in code by dynamic getter:
> Important: Adjustable elements is useful only for VoiceOver and will brake behaviour for Voice Control and Switch Control.

```
var isAccessibilityElement: Bool {
UIAccessibility.isVoiceOverRunning
}
Distinguish behaviour in code by dynamic getter:

var accessibilityTraits: UIAccessibilityTraits {
if UIAccessibility.isVoiceOverRunning {
return [.adjustable]
} else {
return .none
```
var isAccessibilityElement: Bool {
UIAccessibility.isVoiceOverRunning
}
}
```

### Selection follow focus
var accessibilityTraits: UIAccessibilityTraits {
if UIAccessibility.isVoiceOverRunning {
return [.adjustable]
} else {
return .none
}
}
```

@Comment {
// TODO: Selection follow focus
// TODO: Visual Samples
}
### Selection follow focus

### `button` and `adjustable`
@Comment {
// TODO: Selection follow focus
// TODO: Visual Samples
}

@Comment {
// TODO: Stories sample
}
### `button` and `adjustable`

### Tutorial
@Comment {
// TODO: Stories sample
}

See tutorial <doc:AdjustableTutorial>
### Tutorial

See tutorial <doc:AdjustableTutorial>
}

Original file line number Diff line number Diff line change
Expand Up @@ -114,7 +114,7 @@
}

@Step {
Pay attention that *action buttons* should have **short and comrehensible labels that describe what this button does**. Do not use the word "button" in its label: if spoken by [`VoiceOver`](<doc: VoiceOver>), it is doubled since having `Trait` specified causes the screenreader to tell the user that the element is a button.
Pay attention that *action buttons* should have **short and comrehensible labels that describe what this button does**. Do not use the word "button" in its label: if spoken by [`VoiceOver`](<doc:VoiceOver>), it is doubled since having `Trait` specified causes the screenreader to tell the user that the element is a button.


@Image(source: placeholder-image.png, alt: "")
Expand Down Expand Up @@ -147,9 +147,7 @@
@Step {
Breaking the provided information into categories, pizza's name will serve as `Label` and everything else will go to `Value`.

Notice that if both stated, `Label` and `Value` are separated by a *comma* in speech — [`VoiceOver`](<doc: VoiceOver>) will put a *pause* between them on its own.

But everything that happens inside the properties in terms of **pronunciation** is *our* responsibility. **Don't forget to use *punctuation marks* to help `VoiceOver` read texts *easier* for humans to listen to**.
Notice that if both stated, `Label` and `Value` are separated by a *comma* in speech — [`VoiceOver`](<doc:VoiceOver>) will put a *pause* between them on its own. But everything that happens inside the properties in terms of **pronunciation** is *our* responsibility. **Don't forget to use *punctuation marks* to help `VoiceOver` read texts *easier* for humans to listen to**.


@Image(source: chapter-placeholder.png, alt: "")
Expand Down Expand Up @@ -208,7 +206,7 @@
}
}

@Section(title: "What Now?") {
@Section(title: "What now") {
@ContentAndMedia {
Congratulations! Now you know everything needed to fully **describe elements for *both* users and assistive technology** they use.

Expand All @@ -217,7 +215,6 @@
@Image(source: chapter-placeholder.png, alt: "")
}
}

@Assessments {
@MultipleChoice {
Is this item accessible?
Expand Down
Loading

0 comments on commit f05eb68

Please sign in to comment.