Skip to content

Commit

Permalink
fix: filter scrolls for scrollable views
Browse files Browse the repository at this point in the history
  • Loading branch information
PouriaAmini committed Aug 3, 2024
1 parent b2365bd commit ead46b2
Showing 1 changed file with 2 additions and 4 deletions.
6 changes: 2 additions & 4 deletions Sources/Amplitude/Plugins/iOS/UIKitElementInteractions.swift
Original file line number Diff line number Diff line change
Expand Up @@ -123,10 +123,8 @@ extension UIGestureRecognizer {

guard state == .ended, let view else { return }

// TODO: Reduce SwiftUI noise by filtering out system gesture recognizers.
// Currently, the gesture recognizers with a SwiftUI view are blocked.
let viewClass = NSStringFromClass(type(of: view as AnyObject))
if viewClass.contains("SwiftUI") {
// Block scroll events for `UIScrollView`.
if view is UIScrollView && self is UIPanGestureRecognizer {
return
}

Expand Down

0 comments on commit ead46b2

Please sign in to comment.