Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Add ability for a swipe to dismiss pop tip. #42

Merged

Conversation

jeffscaturro-wf
Copy link
Contributor

DESCRIPTION

There is currently an option to dismiss the PopTip when a tap is performed outside of the PopTip. There should also be the option to dismiss the PopTip when a swipe is performed outside of the PopTip. Some PopTips may read "Swipe left to do X", in which case a user performing a swipe should be able to dismiss that PopTip.

PROPOSED CHANGES

Add a UISwipeGestureRecognizer that will dismiss the PopTip when a swipe is performed. Due to adding an additional removeGesture I renamed the existing to tapRemoveGesture and added swipeRemoveGesture. The swipe direction is defaulted to UISwipeGestureRecognizerDirectionRight. The direction can also be set if you want to use a different swipe direction.

This was kept out of the commonInit to avoid accidentally enabling this feature for users.

TESTING SUGGESTIONS

  • Point your podfile (or however you pull this in) at this branch/commit, or pull in this change.
  • Where you initialize your PopTip, add self.shouldDismissOnSwipeOutside = YES;
    • Perform a right swipe with a PopTip displayed, and it should dismiss it.
  • After that line you just added, add self.swipeRemoveGestureDirection = UISwipeGestureRecognizerDirectionLeft;.
    • Perform a left swipe, and the PopTip should be dismissed.
  • Without shouldDismissOnSwipeOutside set to YES, swipes should not dismiss the PopTip, regardless if the direction is set.

Please Review: @andreamazz

andreamazz added a commit that referenced this pull request Jul 3, 2015
Add ability for a swipe to dismiss pop tip.
@andreamazz andreamazz merged commit 1f8386b into andreamazz:master Jul 3, 2015
@andreamazz
Copy link
Owner

Hi @jeffscaturro-wf
Thank you for your contribution. Merging.

@jeffscaturro-wf jeffscaturro-wf deleted the swipe_gesture_to_dismiss branch July 6, 2015 14:37
@jeffscaturro-wf
Copy link
Contributor Author

Thanks for the quick response @andreamazz!

@kevinfur
Copy link

I added this issue about this function. What do you think?

@jeffscaturro-wf
Copy link
Contributor Author

Commented: #102 (comment).

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.

None yet

3 participants