Skip to content

Commit

Permalink
Merge pull request #100 from RxSwiftCommunity/feature/docsFromReadme
Browse files Browse the repository at this point in the history
Add documentation for RxGestureRecognizerDelegate properties
  • Loading branch information
jegnux authored Aug 19, 2019
2 parents 5324363 + 4ee1d6f commit bd13354
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 bd13354

Please sign in to comment.