Skip to content

Commit 277e9a1

Browse files
committed
chore: improve some accessibility modifiers, add Text, LocalizedString, and Label structures
1 parent cf0bfc2 commit 277e9a1

28 files changed

+757
-115
lines changed
Lines changed: 6 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,6 @@
1+
import Foundation
2+
3+
public struct AccessibilityActionResult {
4+
public init() {
5+
}
6+
}
Lines changed: 19 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,19 @@
1+
import Foundation
2+
3+
class AccessibilityActionStorage<Value> : AnyAccessibilityAction {
4+
var action: Value
5+
var category: AccessibilityActionCategory?
6+
var label: Text?
7+
var image: Image?
8+
var handler: Any?
9+
var seed: Int
10+
11+
init(action: Value, category: AccessibilityActionCategory?, label: Text?, image: Image?, handler: Any?, seed: Int) {
12+
self.action = action
13+
self.category = category
14+
self.label = label
15+
self.image = image
16+
self.handler = handler
17+
self.seed = seed
18+
}
19+
}
Lines changed: 11 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,11 @@
1+
import Foundation
2+
3+
public struct AccessibilityAttachment {
4+
var properties: AccessibilityProperties
5+
var platformElement: (any PlatformAccessibilityElementProtocol)?
6+
7+
init(properties: AccessibilityProperties, platformElement: (any PlatformAccessibilityElementProtocol)?) {
8+
self.properties = properties
9+
self.platformElement = platformElement
10+
}
11+
}

Sources/OpenSwiftUI/Accessibility/Accessibility Fundamentals/AccessibilityAttachmentModifier.swift

Lines changed: 6 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -2,6 +2,11 @@ import Foundation
22

33
/// A view modifier that adds accessibility properties to the view
44
public struct AccessibilityAttachmentModifier {
5-
public init() {
5+
let storage: MutableBox<AccessibilityAttachment>
6+
let behavior: AccessibilityChildBehavior?
7+
8+
public init(storage: MutableBox<AccessibilityAttachment>, behavior: AccessibilityChildBehavior?) {
9+
self.storage = storage
10+
self.behavior = behavior
611
}
712
}
Lines changed: 9 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,9 @@
1+
import Foundation
2+
3+
class AccessibilityProperties {
4+
let storage: [ObjectIdentifier: Any]
5+
6+
init(storage: [ObjectIdentifier: Any]) {
7+
self.storage = storage
8+
}
9+
}
Lines changed: 9 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,9 @@
1+
import Foundation
2+
3+
class AccessibilityPropertiesEntry<Value> {
4+
let typedValue: Value
5+
6+
init(typedValue: Value) {
7+
self.typedValue = typedValue
8+
}
9+
}
Lines changed: 6 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,6 @@
1+
import Foundation
2+
3+
struct AccessibilityScrollAction {
4+
init() {
5+
}
6+
}
Lines changed: 9 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,9 @@
1+
import Foundation
2+
3+
class AccessibilityVoidAction {
4+
var kind: AccessibilityActionKind
5+
6+
init(kind: AccessibilityActionKind) {
7+
self.kind = kind
8+
}
9+
}
Lines changed: 5 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,5 @@
1+
import Foundation
2+
3+
class AnyAccessibilityAction {
4+
var bridged: Bool = false
5+
}
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,4 @@
1+
import Foundation
2+
3+
protocol PlatformAccessibilityElementProtocol {
4+
}

0 commit comments

Comments
 (0)