Skip to content

Commit

Permalink
fix: Fix code compatibility issues on Xcode 14.1 (#213)
Browse files Browse the repository at this point in the history
* fix: make source code compatibale with xcode 14.1

* fix: replace var with let for gestureAction
  • Loading branch information
PouriaAmini authored Aug 16, 2024
1 parent 9329a26 commit b2022b6
Show file tree
Hide file tree
Showing 2 changed files with 19 additions and 10 deletions.
27 changes: 18 additions & 9 deletions Sources/Amplitude/Plugins/iOS/UIKitElementInteractions.swift
Original file line number Diff line number Diff line change
Expand Up @@ -125,17 +125,26 @@ extension UIGestureRecognizer {
return
}

let gestureAction: String? = switch self {
case is UITapGestureRecognizer: "tap"
case is UISwipeGestureRecognizer: "swipe"
case is UIPanGestureRecognizer: "pan"
case is UILongPressGestureRecognizer: "longPress"
let gestureAction: String?
switch self {
case is UITapGestureRecognizer:
gestureAction = "tap"
case is UISwipeGestureRecognizer:
gestureAction = "swipe"
case is UIPanGestureRecognizer:
gestureAction = "pan"
case is UILongPressGestureRecognizer:
gestureAction = "longPress"
#if !os(tvOS)
case is UIPinchGestureRecognizer: "pinch"
case is UIRotationGestureRecognizer: "rotation"
case is UIScreenEdgePanGestureRecognizer: "screenEdgePan"
case is UIPinchGestureRecognizer:
gestureAction = "pinch"
case is UIRotationGestureRecognizer:
gestureAction = "rotation"
case is UIScreenEdgePanGestureRecognizer:
gestureAction = "screenEdgePan"
#endif
default: nil
default:
gestureAction = nil
}

guard let gestureAction else { return }
Expand Down
2 changes: 1 addition & 1 deletion Tests/AmplitudeTests/Amplitude+Extensions.swift
Original file line number Diff line number Diff line change
Expand Up @@ -18,6 +18,6 @@ extension Amplitude {
waitForQueueExpectation.fulfill()
}

XCTWaiter().wait(for: [waitForQueueExpectation])
XCTWaiter().wait(for: [waitForQueueExpectation], timeout: 10)
}
}

0 comments on commit b2022b6

Please sign in to comment.