From ba38504c18aee21c98b7f14862894db98d8754bf Mon Sep 17 00:00:00 2001 From: Warif Akhand Rishi Date: Thu, 2 Jun 2016 16:08:57 +0600 Subject: [PATCH] Update README.md --- README.md | 10 +++++++++- 1 file changed, 9 insertions(+), 1 deletion(-) diff --git a/README.md b/README.md index 8dca59b..8dae7e7 100644 --- a/README.md +++ b/README.md @@ -8,4 +8,12 @@ To answer this question: http://stackoverflow.com/q/35388985/1378447 -How can I implement "drag right to dismiss" a View Controller that's in a navigation stack? +**How can I implement "drag right to dismiss" a View Controller that's in a navigation stack?** + +By default, if you drag right from the left edge of the screen, it will drag away the ViewController and take it off the stack. + +I want to extend this functionality to the entire screen. When the user drags right anywhere, I'd like the same to happen. + +I know that I can implement a swipe right gesture and simply call self.navigationController?.popViewControllerAnimated(true) + +However, there is no "dragging" motion. I want the user to be able to right-drag the view controller as if it's an object, revealing what's underneath. And, if it's dragged past 50%, dismiss it. (Check out instagram to see what I mean.)