Skip to content
Merged
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
Original file line number Diff line number Diff line change
Expand Up @@ -38,6 +38,9 @@ struct OnboardingViewRegular<ViewModel: OnboardingCardInfoModelProtocol>: Themea
}
.cardBackground(theme: theme, cornerRadius: UX.CardView.cornerRadius)
}
.accessibilityScrollAction { edge in
Copy link
Collaborator

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Curious, what gesture activates this method?

Copy link
Collaborator Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

sure, this gesture stubs the default scroll gesture for the Voice over, giving us the ability to handle scroll ourself instead of using the default.

handleAccessibilityScroll(from: edge)
}
Button(action: viewModel.skipOnboarding) {
Text(viewModel.skipText)
.font(FXFontStyles.Bold.body.scaledSwiftUIFont(sizeCap: UX.Onboarding.Font.skipButtonSizeCap))
Expand Down Expand Up @@ -74,4 +77,19 @@ struct OnboardingViewRegular<ViewModel: OnboardingCardInfoModelProtocol>: Themea
)
.padding(.bottom)
}

private func handleAccessibilityScroll(from edge: Edge) {
if edge == .leading {
viewModel.scrollToPreviousPage()
} else if edge == .trailing {
viewModel.scrollToNextPage()
}
switch edge {
case .leading, .trailing:
DispatchQueue.main.async {
UIAccessibility.post(notification: .screenChanged, argument: nil)
}
default: break
}
}
}