ios - check for specific gesture recognizer -
i have uipageviewcontroller contains vcs. in pageviewcontroller can swipe left, right change vcs. everytime animation finish add gesturerecognizer it. question how check view have specific recognizer or not? need code this:
if check view has specific recognizer == false { add recognizer }else{ skip. }
i doing because have sidebarmenu. when sidebarmenu appears want add gesture current index pagecontentviewcontroller. so, code works fine, dont want add gesture everytime animation finishes.
i adding code. problem gestures created in other class(not current). first creating instance of class keep gestures:
let transtionmanger = transitionmanger()
after add var of class named exitpangesture:
pagecontentviewcontroller.view.addgesturerecognizer(transtionmanger.exitpangesture3)
the problem add everytime view appears. want check existence of gesture before adding it. dont want add everytime.
is looking for? please see comments explanation:
// if gesture recogniser added view (change view view want test) if let recognizers = view.gesturerecognizers { gr in recognizers { // check uipangesturerecognizer can check 1 need if let grecognizer = gr as? uipangesturerecognizer { println("gesture recognizer found") } } }
Comments
Post a Comment