Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

fix: 🐛 simultaneous gesture is not triggered in voice over #599

Merged
merged 22 commits into from
Sep 26, 2023
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
Show all changes
22 commits
Select commit Hold shift + click to select a range
e519277
fix: 🐛 map unsupported weight and trait combo to existing fonts
billzhou0223 Mar 22, 2023
b380b69
chore: 🤖 Fix a minor compilation issue
billzhou0223 Mar 22, 2023
5eac446
chore: 🤖 fix a compilation issue
billzhou0223 Mar 22, 2023
27fa347
chore: 🤖 fix a compilation issue
billzhou0223 Mar 22, 2023
fa95411
chore: 🤖 fix a compilation issue
billzhou0223 Mar 22, 2023
2e04678
chore: 🤖 fix a compilation issue in Xcode 14.3
billzhou0223 Mar 27, 2023
21e1100
Merge branch 'main' of github.com:SAP/cloud-sdk-ios-fiori
billzhou0223 Mar 27, 2023
91f9cb3
Merge branch 'main' of github.com:SAP/cloud-sdk-ios-fiori
billzhou0223 Mar 27, 2023
2ff35c5
Merge branch 'main' of github.com:SAP/cloud-sdk-ios-fiori
billzhou0223 Mar 27, 2023
5e20b79
Merge branch 'main' of github.com:SAP/cloud-sdk-ios-fiori
billzhou0223 Mar 27, 2023
75ba732
Merge branch 'main' of github.com:SAP/cloud-sdk-ios-fiori
billzhou0223 Apr 13, 2023
2ff3c62
Merge branch 'main' of github.com:SAP/cloud-sdk-ios-fiori
billzhou0223 Jun 1, 2023
053beda
Merge branch 'main' of github.com:SAP/cloud-sdk-ios-fiori
billzhou0223 Jun 6, 2023
94d5690
Merge branch 'main' of github.com:SAP/cloud-sdk-ios-fiori
billzhou0223 Jun 6, 2023
a3b9119
Merge branch 'main' of github.com:SAP/cloud-sdk-ios-fiori
billzhou0223 Jun 6, 2023
2682322
Merge branch 'main' of github.com:SAP/cloud-sdk-ios-fiori
billzhou0223 Aug 31, 2023
e9440de
chore: 🤖 fix an error in installGitHooks script
billzhou0223 Sep 2, 2023
3c8c4fa
chore: 🤖 fix a Sourcery api generation issue
billzhou0223 Sep 6, 2023
47d269a
Merge branch 'main' of github.com:SAP/cloud-sdk-ios-fiori
billzhou0223 Sep 6, 2023
08d3757
Merge branch 'main' of github.com:SAP/cloud-sdk-ios-fiori
billzhou0223 Sep 14, 2023
e72034f
fix: 🐛 simultaneous gesture is not triggered in voice over
billzhou0223 Sep 25, 2023
0002f23
Merge branch 'main' of github.com:SAP/cloud-sdk-ios-fiori
billzhou0223 Sep 25, 2023
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
31 changes: 7 additions & 24 deletions Sources/FioriSwiftUICore/Utils/View+Extensions.swift
Original file line number Diff line number Diff line change
Expand Up @@ -3,10 +3,16 @@ import SwiftUI

extension View {
func onSimultaneousTapGesture(count: Int = 1, perform action: @escaping () -> Void) -> some View {
self.simultaneousGesture(TapGesture(count: count).onEnded {
self.accessibilitySimultaneousGesture(TapGesture(count: count).onEnded {
action()
})
}

// In order to fix an issue where the simultaneous gesture is not activated in voice over.
func accessibilitySimultaneousGesture<T>(_ gesture: T, including mask: GestureMask = .all) -> some View where T: Gesture {
simultaneousGesture(gesture, including: mask)
.accessibilityElement()
}
}

extension View {
Expand All @@ -16,27 +22,4 @@ extension View {
Alert(title: configuration.title, message: configuration.message_, primaryButton: .default(configuration.action.label_, action: configuration.action.didSelect ?? {}), secondaryButton: .cancel(configuration.secondaryAction.label_, action: configuration.secondaryAction.didSelect ?? {}))
}
}

// Cause problem generating xcframework in SAPFiori
// @ViewBuilder
// func alert(configuration: AlertConfiguration, isPresented: Binding<Bool>) -> some View {
// #if swift(>=5.5)
// if #available(iOS 15, macOS 12, *) {
// self.alert(configuration.title, isPresented: isPresented) {
// Button(action: configuration.action.didSelect ?? {}, label: { configuration.action.label })
// Button(role: .cancel, action: configuration.secondaryAction.didSelect ?? {}, label: { configuration.secondaryAction.label })
// } message: {
// configuration.message
// }
// } else {
// self.alert(isPresented: isPresented) {
// Alert(title: configuration.title, message: configuration.message_, primaryButton: .default(configuration.action.label_, action: configuration.action.didSelect ?? {}), secondaryButton: .cancel(configuration.secondaryAction.label_, action: configuration.secondaryAction.didSelect ?? {}))
// }
// }
// #else
// self.alert(isPresented: isPresented) {
// Alert(title: configuration.title, message: configuration.message_, primaryButton: .default(configuration.action.label_, action: configuration.action.didSelect ?? {}), secondaryButton: .cancel(configuration.secondaryAction.label_, action: configuration.secondaryAction.didSelect ?? {}))
// }
// #endif
// }
}
10 changes: 5 additions & 5 deletions Sources/FioriSwiftUICore/Views/SignatureCaptureView+View.swift
Original file line number Diff line number Diff line change
Expand Up @@ -78,7 +78,7 @@ extension SignatureCaptureView: View {
.padding(.bottom, 11)
Spacer()
cancelAction
.simultaneousGesture(
.accessibilitySimultaneousGesture(
TapGesture()
.onEnded { _ in
clear()
Expand Down Expand Up @@ -140,7 +140,7 @@ extension SignatureCaptureView: View {
if self.isEditing {
HStack {
clearAction
.simultaneousGesture(
.accessibilitySimultaneousGesture(
TapGesture()
.onEnded { _ in
clear()
Expand All @@ -150,7 +150,7 @@ extension SignatureCaptureView: View {
.frame(minWidth: 44, minHeight: 44)
Spacer()
saveAction
.simultaneousGesture(
.accessibilitySimultaneousGesture(
TapGesture()
.onEnded { _ in
isSaved = true
Expand All @@ -162,7 +162,7 @@ extension SignatureCaptureView: View {
.padding(.top, 8)
} else if (_signatureImage != nil && !isReenterTapped) || fullSignatureImage != nil {
restartAction
.simultaneousGesture(
.accessibilitySimultaneousGesture(
TapGesture()
.onEnded { _ in
UIApplication.shared.sendAction(#selector(UIResponder.resignFirstResponder), to: nil, from: nil, for: nil)
Expand Down Expand Up @@ -209,7 +209,7 @@ extension SignatureCaptureView: View {
ZStack {
Color.preferredColor(.quaternaryFill).cornerRadius(10)
startAction
.simultaneousGesture(
.accessibilitySimultaneousGesture(
TapGesture()
.onEnded { _ in
UIApplication.shared.sendAction(#selector(UIResponder.resignFirstResponder), to: nil, from: nil, for: nil)
Expand Down