Skip to content

Commit 24ca365

Browse files
authored
fix: 🐛 simultaneous gesture is not triggered in voice over (#599)
* fix: 🐛 map unsupported weight and trait combo to existing fonts * chore: 🤖 Fix a minor compilation issue * chore: 🤖 fix a compilation issue * chore: 🤖 fix a compilation issue * chore: 🤖 fix a compilation issue * chore: 🤖 fix a compilation issue in Xcode 14.3 * chore: 🤖 fix an error in installGitHooks script * chore: 🤖 fix a Sourcery api generation issue API generated for binding property is not correct * fix: 🐛 simultaneous gesture is not triggered in voice over
1 parent 4c3e275 commit 24ca365

File tree

2 files changed

+12
-29
lines changed

2 files changed

+12
-29
lines changed

Sources/FioriSwiftUICore/Utils/View+Extensions.swift

+7-24
Original file line numberDiff line numberDiff line change
@@ -3,10 +3,16 @@ import SwiftUI
33

44
extension View {
55
func onSimultaneousTapGesture(count: Int = 1, perform action: @escaping () -> Void) -> some View {
6-
self.simultaneousGesture(TapGesture(count: count).onEnded {
6+
self.accessibilitySimultaneousGesture(TapGesture(count: count).onEnded {
77
action()
88
})
99
}
10+
11+
// In order to fix an issue where the simultaneous gesture is not activated in voice over.
12+
func accessibilitySimultaneousGesture<T>(_ gesture: T, including mask: GestureMask = .all) -> some View where T: Gesture {
13+
simultaneousGesture(gesture, including: mask)
14+
.accessibilityElement()
15+
}
1016
}
1117

1218
extension View {
@@ -16,27 +22,4 @@ extension View {
1622
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 ?? {}))
1723
}
1824
}
19-
20-
// Cause problem generating xcframework in SAPFiori
21-
// @ViewBuilder
22-
// func alert(configuration: AlertConfiguration, isPresented: Binding<Bool>) -> some View {
23-
// #if swift(>=5.5)
24-
// if #available(iOS 15, macOS 12, *) {
25-
// self.alert(configuration.title, isPresented: isPresented) {
26-
// Button(action: configuration.action.didSelect ?? {}, label: { configuration.action.label })
27-
// Button(role: .cancel, action: configuration.secondaryAction.didSelect ?? {}, label: { configuration.secondaryAction.label })
28-
// } message: {
29-
// configuration.message
30-
// }
31-
// } else {
32-
// self.alert(isPresented: isPresented) {
33-
// 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 ?? {}))
34-
// }
35-
// }
36-
// #else
37-
// self.alert(isPresented: isPresented) {
38-
// 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 ?? {}))
39-
// }
40-
// #endif
41-
// }
4225
}

Sources/FioriSwiftUICore/Views/SignatureCaptureView+View.swift

+5-5
Original file line numberDiff line numberDiff line change
@@ -78,7 +78,7 @@ extension SignatureCaptureView: View {
7878
.padding(.bottom, 11)
7979
Spacer()
8080
cancelAction
81-
.simultaneousGesture(
81+
.accessibilitySimultaneousGesture(
8282
TapGesture()
8383
.onEnded { _ in
8484
clear()
@@ -140,7 +140,7 @@ extension SignatureCaptureView: View {
140140
if self.isEditing {
141141
HStack {
142142
clearAction
143-
.simultaneousGesture(
143+
.accessibilitySimultaneousGesture(
144144
TapGesture()
145145
.onEnded { _ in
146146
clear()
@@ -150,7 +150,7 @@ extension SignatureCaptureView: View {
150150
.frame(minWidth: 44, minHeight: 44)
151151
Spacer()
152152
saveAction
153-
.simultaneousGesture(
153+
.accessibilitySimultaneousGesture(
154154
TapGesture()
155155
.onEnded { _ in
156156
isSaved = true
@@ -162,7 +162,7 @@ extension SignatureCaptureView: View {
162162
.padding(.top, 8)
163163
} else if (_signatureImage != nil && !isReenterTapped) || fullSignatureImage != nil {
164164
restartAction
165-
.simultaneousGesture(
165+
.accessibilitySimultaneousGesture(
166166
TapGesture()
167167
.onEnded { _ in
168168
UIApplication.shared.sendAction(#selector(UIResponder.resignFirstResponder), to: nil, from: nil, for: nil)
@@ -209,7 +209,7 @@ extension SignatureCaptureView: View {
209209
ZStack {
210210
Color.preferredColor(.quaternaryFill).cornerRadius(10)
211211
startAction
212-
.simultaneousGesture(
212+
.accessibilitySimultaneousGesture(
213213
TapGesture()
214214
.onEnded { _ in
215215
UIApplication.shared.sendAction(#selector(UIResponder.resignFirstResponder), to: nil, from: nil, for: nil)

0 commit comments

Comments
 (0)