Skip to content

Commit

Permalink
fix: fix pinchGestureRecognizer unavailability issue on tvos (#217)
Browse files Browse the repository at this point in the history
  • Loading branch information
PouriaAmini authored Aug 23, 2024
1 parent 056ccbf commit 4c5ae67
Showing 1 changed file with 10 additions and 2 deletions.
12 changes: 10 additions & 2 deletions Sources/Amplitude/Plugins/iOS/UIKitElementInteractions.swift
Original file line number Diff line number Diff line change
Expand Up @@ -121,8 +121,16 @@ extension UIGestureRecognizer {
guard state == .ended, let view else { return }

// Block scroll and zoom events for `UIScrollView`.
if let scrollView = view as? UIScrollView, self === scrollView.panGestureRecognizer || self === scrollView.pinchGestureRecognizer {
return
if let scrollView = view as? UIScrollView {
if self === scrollView.panGestureRecognizer {
return
}

#if !os(tvOS)
if self === scrollView.pinchGestureRecognizer {
return
}
#endif
}

let gestureAction: String?
Expand Down

0 comments on commit 4c5ae67

Please sign in to comment.