-
Notifications
You must be signed in to change notification settings - Fork 0
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
no pinetrees and old structure ghosts
- Loading branch information
1 parent
348c61d
commit f05eb68
Showing
7 changed files
with
420 additions
and
417 deletions.
There are no files selected for viewing
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
85 changes: 43 additions & 42 deletions
85
...ok.docc/Pages/AdaptionTechniques/Advanced/VerticalSwipes/aAdjustableElements.md
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
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> | ||
} | ||
|
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Oops, something went wrong.