iphone - warning: class 'CardController' does not implement the 'UIGestureRecognizerDelegate' protocol -


in app trying detect swipe gesture navigate next page ...

please find below code below

uiswipegesturerecognizer *swiperight = [[uiswipegesturerecognizer alloc] initwithtarget:self action:@selector(swiperightaction:)]; swiperight.direction = uiswipegesturerecognizerdirectionright; swiperight.delegate = self; [cardsgridview addgesturerecognizer:swiperight]; 

when run application, below warning...

warning: class 'mygesture' not implement 'uigesturerecognizerdelegate' protocol 

kindly me missing here.

update1 : can pls show me working code detect swipe....

the uigesturerecognizerdelegate protocol defines optional methods. there 2 ways rid of warning:

  1. do not set delegate @ if not need of optional delegate methods. swiperightaction method call work anyway specify target , selector in initializer.
  2. if need set delegate, indicate in header file of delegate class class implements protocol specifying in angle brackets after superclass name:

    @interface yourclass : uiviewcontroller <uigesturerecognizerdelegate> { ... }

edit: thanks, forgot escape angle brackets.


Comments

Popular posts from this blog

asp.net - repeatedly call AddImageUrl(url) to assemble pdf document -

java - Android recognize cell phone with keyboard or not? -

iphone - How would you achieve a LED Scrolling effect? -