From b1252bb75fef9c62c115925cefdede186a96298a Mon Sep 17 00:00:00 2001 From: Fabian Oudhaarlem Date: Tue, 23 Dec 2014 11:43:17 +0100 Subject: [PATCH] Added edge param to when_screen_edge_panned method When using UIScreenEdgePanGestureRecognizer we need to set the edge after initialization. Added the option to pass the edge to the method. --- motion/ui/ui_view_wrapper.rb | 6 ++++-- 1 file changed, 4 insertions(+), 2 deletions(-) diff --git a/motion/ui/ui_view_wrapper.rb b/motion/ui/ui_view_wrapper.rb index 5faa9e01..08a92890 100644 --- a/motion/ui/ui_view_wrapper.rb +++ b/motion/ui/ui_view_wrapper.rb @@ -20,8 +20,10 @@ def when_panned(enableInteraction=true, &proc) add_gesture_recognizer_helper(UIPanGestureRecognizer.alloc.initWithTarget(self, action:'handle_gesture:'), enableInteraction, proc) end - def when_screen_edge_panned(enableInteraction=true, &proc) - add_gesture_recognizer_helper(UIScreenEdgePanGestureRecognizer.alloc.initWithTarget(self, action:'handle_gesture:'), enableInteraction, proc) + def when_screen_edge_panned(enableInteraction=true, edge=UIRectEdgeRight, &proc) + gesture_recognizer = UIScreenEdgePanGestureRecognizer.alloc.initWithTarget(self, action:'handle_gesture:') + gesture_recognizer.edges = edge + add_gesture_recognizer_helper(gesture_recognizer, enableInteraction, proc) end def when_pressed(enableInteraction=true, &proc)