Skip to content

Commit

Permalink
Add documentation for RxGestureRecognizerDelegate properties
Browse files Browse the repository at this point in the history
  • Loading branch information
M0rtyMerr committed Aug 18, 2019
1 parent 5324363 commit 4ee1d6f
Showing 1 changed file with 7 additions and 0 deletions.
7 changes: 7 additions & 0 deletions Pod/Classes/RxGestureRecognizerDelegate.swift
Original file line number Diff line number Diff line change
Expand Up @@ -55,21 +55,27 @@ public struct GestureRecognizerDelegatePolicy<PolicyInput> {

public final class RxGestureRecognizerDelegate: NSObject, GestureRecognizerDelegate {

/// Corresponding delegate method: gestureRecognizerShouldBegin(:_)
public var beginPolicy: GestureRecognizerDelegatePolicy<GestureRecognizer> = .always

/// Corresponding delegate method: gestureRecognizer(_:shouldReceive:)
public var touchReceptionPolicy: GestureRecognizerDelegatePolicy<(GestureRecognizer, Touch)> = .always

/// Corresponding delegate method: gestureRecognizer(_:shouldBeRequiredToFailBy:)
public var selfFailureRequirementPolicy: GestureRecognizerDelegatePolicy<(GestureRecognizer, GestureRecognizer)> = .never

/// Corresponding delegate method: gestureRecognizer(_:shouldRequireFailureOf:)
public var otherFailureRequirementPolicy: GestureRecognizerDelegatePolicy<(GestureRecognizer, GestureRecognizer)> = .never

/// Corresponding delegate method: gestureRecognizer(_:shouldRecognizeSimultaneouslyWith:)
public var simultaneousRecognitionPolicy: GestureRecognizerDelegatePolicy<(GestureRecognizer, GestureRecognizer)> = .always

#if os(iOS)
// Workaround because we can't have stored properties with @available annotation
private var _pressReceptionPolicy: Any?

@available(iOS 9.0, *)
/// Corresponding delegate method: gestureRecognizer(_:shouldReceive:)
public var pressReceptionPolicy: GestureRecognizerDelegatePolicy<(GestureRecognizer, UIPress)> {
get {
if let policy = _pressReceptionPolicy as? GestureRecognizerDelegatePolicy<(GestureRecognizer, UIPress)> {
Expand All @@ -84,6 +90,7 @@ public final class RxGestureRecognizerDelegate: NSObject, GestureRecognizerDeleg
#endif

#if os(OSX)
/// Corresponding delegate method: gestureRecognizer(_:shouldAttemptToRecognizeWith:)
public var eventRecognitionAttemptPolicy: GestureRecognizerDelegatePolicy<(GestureRecognizer, NSEvent)> = .always
#endif

Expand Down

0 comments on commit 4ee1d6f

Please sign in to comment.