Skip to content

Commit

Permalink
trying to perserve the spacer
Browse files Browse the repository at this point in the history
  • Loading branch information
RoyalPineapple committed Jan 30, 2024
1 parent 22603cc commit 89ec74e
Showing 1 changed file with 61 additions and 57 deletions.
118 changes: 61 additions & 57 deletions Example/AccessibilitySnapshot/SwiftUIView.swift
Original file line number Diff line number Diff line change
Expand Up @@ -28,72 +28,76 @@ fileprivate struct Circle: View {
struct SwiftUIView: View {
var body: some View {
VStack(spacing: 30) {
// View with nothing.
Circle()
.accessibility(label: Text(""))
.accessibility(value: Text(""))
.accessibility(hint: Text(""))

// View with label.
Circle()
.accessibility(label: Text("Label"))
.accessibility(value: Text(""))
.accessibility(hint: Text(""))

// View with value.
Circle()
.accessibility(label: Text(""))
.accessibility(value: Text("Value"))
.accessibility(hint: Text(""))

// View with hint.
Circle()
.accessibility(label: Text(""))
.accessibility(value: Text(""))
.accessibility(hint: Text("Hint"))

// View with label and value.
Circle()
.accessibility(label: Text("Label"))
.accessibility(value: Text("Value"))
.accessibility(hint: Text(""))

// View with label and hint.
Circle()
.accessibility(label: Text("Label"))
.accessibility(value: Text(""))
.accessibility(hint: Text("Hint"))

// View with value and hint.
Circle()
.accessibility(label: Text(""))
.accessibility(value: Text("Value"))
.accessibility(hint: Text("Hint"))

// View with label, value, and hint.
Circle()
.accessibility(label: Text("Label"))
.accessibility(value: Text("Value"))
.accessibility(hint: Text("Hint"))

if #available(iOS 14.0, *) {
// View with label, value, hint, and Custom Actions.
Group {
// View with nothing.
Circle()
.accessibility(label: Text(""))
.accessibility(value: Text(""))
.accessibility(hint: Text(""))

// View with label.
Circle()
.accessibility(label: Text("Label"))
.accessibility(value: Text(""))
.accessibility(hint: Text(""))

// View with value.
Circle()
.accessibility(label: Text(""))
.accessibility(value: Text("Value"))
.accessibility(hint: Text(""))

// View with hint.
Circle()
.accessibility(label: Text(""))
.accessibility(value: Text(""))
.accessibility(hint: Text("Hint"))
.accessibilityAction(named: "Custom") {}
}

if #available(iOS 15.0, *) {
// View with label, value, hint, and Custom Content.

// View with label and value.
Circle()
.accessibility(label: Text("Label"))
.accessibility(value: Text("Value"))
.accessibility(hint: Text(""))

// View with label and hint.
Circle()
.accessibility(label: Text("Label"))
.accessibility(value: Text(""))
.accessibility(hint: Text("Hint"))

// View with value and hint.
Circle()
.accessibility(label: Text(""))
.accessibility(value: Text("Value"))
.accessibility(hint: Text("Hint"))
.accessibilityCustomContent("Key", "Value")
.accessibilityCustomContent("Important Key", "Important Value", importance: .high)

// View with label, value, and hint.
Circle()
.accessibility(label: Text("Label"))
.accessibility(value: Text("Value"))
.accessibility(hint: Text("Hint"))

if #available(iOS 14.0, *) {
// View with label, value, hint, and Custom Actions.
Circle()
.accessibility(label: Text("Label"))
.accessibility(value: Text("Value"))
.accessibility(hint: Text("Hint"))
.accessibilityAction(named: "Custom") {}
}

if #available(iOS 15.0, *) {
// View with label, value, hint, and Custom Content.
Circle()
.accessibility(label: Text("Label"))
.accessibility(value: Text("Value"))
.accessibility(hint: Text("Hint"))
.accessibilityCustomContent("Key", "Value")
.accessibilityCustomContent("Important Key", "Important Value", importance: .high)
}
}

Spacer()
}
}
}
Expand Down

0 comments on commit 89ec74e

Please sign in to comment.