Skip to content

Commit

Permalink
Fix tvOS support
Browse files Browse the repository at this point in the history
  • Loading branch information
ShinryakuTako committed Dec 26, 2019
1 parent a0aa210 commit 334a8e0
Show file tree
Hide file tree
Showing 2 changed files with 11 additions and 6 deletions.
Original file line number Diff line number Diff line change
Expand Up @@ -45,6 +45,11 @@ public typealias OSClickOrTapGestureRecognizer = UITapGestureRecognizer
public typealias OSPanGestureRecognizer = UIPanGestureRecognizer

public typealias OSMouseOrTouchEventComponent = TouchEventComponent
public typealias OSClickOrTapGestureRecognizerComponent = TapGestureRecognizerComponent

#endif

#if os(iOS)

public typealias OSClickOrTapGestureRecognizerComponent = TapGestureRecognizerComponent // Not available on tvOS

#endif
Original file line number Diff line number Diff line change
Expand Up @@ -30,14 +30,14 @@ public final class PanGestureRecognizerComponent: OctopusGestureRecognizerCompon
super.init()
self.gestureRecognizer.delegate = self

#if canImport(AppKit)
self.compatibleGestureRecognizerTypes = [NSMagnificationGestureRecognizer.self]
#elseif canImport(UIKit)
#if os(iOS)
self.compatibleGestureRecognizerTypes = [UIPinchGestureRecognizer.self]
#elseif os(macOS)
self.compatibleGestureRecognizerTypes = [NSMagnificationGestureRecognizer.self]
#endif
}

#if canImport(UIKit) // MARK: - iOS
#if os(iOS) // MARK: - iOS

/// - NOTE: Unless specified, `maximumNumberOfTouches` will be set equal to `minimumNumberOfTouches`.
public convenience init(minimumNumberOfTouches: Int = 1,
Expand All @@ -52,7 +52,7 @@ public final class PanGestureRecognizerComponent: OctopusGestureRecognizerCompon

#endif

#if canImport(AppKit) // MARK: - macOS
#if os(macOS) // MARK: - macOS

public convenience init(buttonMask: Int = 0x1,
numberOfTouchesRequired: Int = 1)
Expand Down

0 comments on commit 334a8e0

Please sign in to comment.