ios - Detecting a swipe that started outside of Gesture Recognizer object's area -


i trying detect swipes in specific way, , having mixed results. first problem recognizing swipes in region of screen, solved. current problem this: let's have thing column in view, , make dimensions of column correspond gesture recognizer. when using app, swipe must begin within dimensions recognized swipe. instead, need recognize swipe if user started swiping outside column's area. in fact, don't care if swipe, tap or fine, want know if user's fingers have ever been within column (and in case started swipe outside column's area).

here current code words, swipe must start within column:

- (ibaction)swipermethod:(uiswipegesturerecognizer *)sender {     cgpoint point = [sender locationinview:self.view];     if(point.y < 316 && point.y > 76 && point.x < 234 && point.x > 164)     {         _sampletext.text=@"hi";     } }  - (void)viewdidload {     [super viewdidload];     uiswipegesturerecognizer *leftrecognizer = [[uiswipegesturerecognizer alloc] initwithtarget:self action:@selector(swipermethod:)];     [leftrecognizer setdirection: uiswipegesturerecognizerdirectionleft];     [[self view] addgesturerecognizer:leftrecognizer];     // additional setup after loading view, typically nib. } 

can please show me how make swipe (or whatever gesture, don't care being swipe) recognized if user drag's his/her finger across area?

thanks!

this method works!

- (void)touchesmoved:(nsset *)touches withevent:(uievent *)event {     uitouch * touch = [[event alltouches] anyobject];     cgpoint point = [touch locationinview:touch.view];     if(point.y < 316 && point.y > 76 && point.x < 234 && point.x > 164)     {         _sample.image = [uiimage imagenamed:@"normal.png"];     }     else     {         _star.image = [uiimage imagenamed:@"alternate.png"];     }  } 

Comments

Popular posts from this blog

SPSS keyboard combination alters encoding -

Add new record to the table by click on the button in Microsoft Access -

javascript - jQuery .height() return 0 when visible but non-0 when hidden -