ios - UISwipeGestureRecognizer interferes with slider -


i have view in ios application (obj-c) has image view in centre, , below slider. image view shows album artwork, , slider can used adjust now-playing track position.

there pair of left , right swipe gesture recognizers. these used skip next or previous tracks.

the problem swipe gesture recognizers seem over-ride users moving slider thumb. in gesture recognizer code check point touched inside image view, still stops slider being moved. (the thumb moves, jumps it's original position when remove finger).

this code use reject gesture if it's not inside image view.

- (ibaction)swipeleftgestureaction:(uiswipegesturerecognizer *)sender {     // location of gesture.     cgpoint tappoint = [sender locationinview:_artworkimageview];      // make sure tap inside artwork image frame.     if( (tappoint.x <0)        || (tappoint.y < 0 )        || (tappoint.x > _artworkimageview.frame.size.width)        || (tappoint.y>_artworkimageview.frame.size.height))     {         nslog(@"outside!");         return;     }     nslog(@"swipe left");     [_mediacontroller skipnext]; } 

so question is, how limit gesture work when swiped across image view?

try put code restricts gesture's area in gesturerecognizer:shouldreceivetouch: , return no in case don't want gesture receive touch. should prevent gesture on taking slider interaction.


Comments

Popular posts from this blog

Magento/PHP - Get phones on all members in a customer group -

php - .htaccess mod_rewrite for dynamic url which has domain names -

Website Login Issue developed in magento -