Skip to content

Commit

Permalink
Update View.swift
Browse files Browse the repository at this point in the history
  • Loading branch information
des12437 committed Jan 3, 2024
1 parent 1d9b5d9 commit d2ba8b1
Showing 1 changed file with 0 additions and 19 deletions.
19 changes: 0 additions & 19 deletions Sources/ArcGISToolkit/Extensions/SwiftUI/View.swift
Original file line number Diff line number Diff line change
Expand Up @@ -122,25 +122,6 @@ extension View {
action()
}
}

/// Sets a closure to perform when a single tap occurs on the view.
/// - Parameters:
/// - action: The closure to perform upon single tap.
/// - screenPoint: The location of the tap in the view's coordinate space.
func onSingleTapGesture(perform action: @escaping (_ screenPoint: CGPoint) -> Void) -> some View {
if #available(iOS 16.0, *) {
return self.onTapGesture { screenPoint in
action(screenPoint)
}
} else {
return self.gesture(
DragGesture()
.onEnded { dragAttributes in
action(dragAttributes.location)
}
)
}
}
}

extension View {
Expand Down

0 comments on commit d2ba8b1

Please sign in to comment.