Skip to content

Make panGesture a public property#29

Open
ajsharp wants to merge 2 commits into
nverinaud:masterfrom
ajsharp:public-pan-gesture
Open

Make panGesture a public property#29
ajsharp wants to merge 2 commits into
nverinaud:masterfrom
ajsharp:public-pan-gesture

Conversation

@ajsharp

@ajsharp ajsharp commented Jan 12, 2014

Copy link
Copy Markdown

It would be nice if panGesture were a public property. Doing so would allow library users to implement a delegate or add targets to the gesture in order to better control it. For example, it's nice to be able to restrict the area that the pan applies to the left portion of the screen. Here's how I do this by implementing one of UIGestureRecognizer delegate methods:

-(BOOL)gestureRecognizerShouldBegin:(UIGestureRecognizer *)gestureRecognizer {
    if ([gestureRecognizer locationInView:gestureRecognizer.view].x < 70.0) {
        return YES;
    }
    return NO;
}

@nverinaud

Copy link
Copy Markdown
Owner

Hum...It could be safer to make the setter private aka readonly property in the .h.

@ajsharp

ajsharp commented Feb 24, 2014

Copy link
Copy Markdown
Author

Yea, good point. So you'd be in favor of making the setter private but the getter public?

@nverinaud

Copy link
Copy Markdown
Owner

Yep !

@ajsharp

ajsharp commented Jun 28, 2014

Copy link
Copy Markdown
Author

@nverinaud Updated this pull request. I think I implemented what we've discussed 😉

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

2 participants