ios - Multiple visible views responding to one gesture recognizer -
i have view controller consists of 3 views (self.panedview, self.view, self.sineview) when swipe gesture detected, highest view (self.panedview) moved halfway - revealing 2 additional views (self.view , self.sineview). self.sineview uiview has animation running renders moving sinewave , takes half of self.view. have swipe downwards gesture recognizer works when swipe downwards on self.panedview, doesn't work when swipe downwards on self.sineview. if swipe around self.sineview on self.view seems work. when hide self.sineview , swipe straight downwards on either self.view or self.paned view, swipe downwards works. think animating sine wave gets in way of gesture recognition.
uiswipegesturerecognizer * swipedownrec = [[uiswipegesturerecognizer alloc] initwithtarget:self action:@selector(handledownswipe:)]; [self.panedview addgesturerecognizer:swipedownrec]; [self.view addgesturerecognizer:swipedownrec]; [self.sineview addgesturerecognizer:swipedownrec];
also tried varying between these 2 lines of code there no difference:
[self.view insertsubview:self.sinewave belowsubview:self.panedview]; [self.view insertsubview:self.sinewave abovesubview:self.view];
i tried adding separate swipe downwards gesture recognizer each view, still doesn't work.
the problem swipe recognizer self.sinewave couldn't recognized while self.sinewave animation enabled. solution simple: add together uiviewanimationoptionallowuserinteraction
parameter options
handler animatewithduration:delay:options:animations:completion:
ios cocoa-touch
No comments:
Post a Comment