ios - SWRevealViewController - How can I make the menu disappear with a tap and/or swipe on FrontViewController -
i developing locator map. how can make menu disappear tap and/or swipe on frontviewcontroller. front view controller map (google map).
you can enable use of swipe gestures close menu in swrevealviewcontroller
adding pan gesture recognizer view in viewdidload:
of view controller.
override func viewdidload() { super.viewdidload() view.addgesturerecognizer(myrevealviewcontroller.pangesturerecognizer()) }
getting menu respond taps requires handling tap action separately tap gesture recognizer.
for example, tap gesture recognizer defined , added view like
mytapgesturerecognizer = uitapgesturerecognizer(target: self, action: "closemenu") view.addgesturerecognizer(mytapgesturerecognizer)
you close menu function using:
func closemenu() { myrevealviewcontroller?.setfrontviewposition(frontviewposition.left, animated: true) }
where .left
frontviewposition
dependent on how have view controllers configured swrevealviewcontroller
.
Comments
Post a Comment