Skip to content

Commit

Permalink
Fix Alert Button not triggering action when using older Xcode version
Browse files Browse the repository at this point in the history
Fixes #28
  • Loading branch information
divadretlaw committed Sep 30, 2024
1 parent f0b0388 commit f1fd435
Showing 1 changed file with 10 additions and 0 deletions.
10 changes: 10 additions & 0 deletions Sources/CustomAlert/Helper/OnSimultaneousTapGesture.swift
Original file line number Diff line number Diff line change
Expand Up @@ -29,6 +29,15 @@ private struct SimultaneousTapGestureViewModifier: ViewModifier {
}

func body(content: Content) -> some View {
#if compiler(<6.0)
content
.overlay(
SimultaneousTapGesture(
numberOfTapsRequired: count,
action: action
)
)
#else
if #available(iOS 18.0, *) {
content
.simultaneousGesture(simultaneousTapGesture)
Expand All @@ -41,6 +50,7 @@ private struct SimultaneousTapGestureViewModifier: ViewModifier {
)
)
}
#endif
}

var simultaneousTapGesture: some Gesture {
Expand Down

0 comments on commit f1fd435

Please sign in to comment.