i'm trying detect continued dragging past bottom of screen. tried using uipangesturerecognizer, stops firing finger reaches edge of screen, except @ top. i'm trying uiscreenedgepangesturerecognizer, although gesturerecognizer delegate method shouldreceivetouch fires, designated selector gesture never fires. appreciated.
this code in viewdidload:
uiscreenedgepangesturerecognizer *selectscreenedgedrag = [[uiscreenedgepangesturerecognizer alloc] initwithtarget:self action:@selector(screenedgeselect:)]; [selectscreenedgedrag setedges:uirectedgebottom]; selectscreenedgedrag.delegate = self; [self.view addgesturerecognizer:selectscreenedgedrag];
delegate methods:
- (void)screenedgeselect:(uiscreenedgepangesturerecognizer *)gesture { nslog(@"screenedgeselect"); } - (bool)gesturerecognizer:(uigesturerecognizer *)gesturerecognizer shouldrecognizesimultaneouslywithgesturerecognizer:(uigesturerecognizer *)othergesturerecognizer { nslog(@"shouldrecognizesimultaneouslywithgesturerecognizer"); return yes; } - (bool)gesturerecognizer:(uigesturerecognizer *)gesturerecognizer shouldreceivepress:(uipress *)press { nslog(@"shouldreceivepress"); return yes; } - (bool)gesturerecognizer:(uigesturerecognizer *)gesturerecognizer shouldreceivetouch:(nonnull uitouch *)touch { nslog(@"shouldreceivetouch"); return yes; } - (bool)gesturerecognizer:(uigesturerecognizer *)gesturerecognizer shouldberequiredtofailbygesturerecognizer:(uigesturerecognizer *)othergesturerecognizer{ return no; }
what doing wrong?
thanks.
it never fires because set edges
property uirectedgebottom
, collides system control center. whenever i'm trying swipe bottom edge control center showing up. if set edges
uirectedgeleft
or uirectedgeright
work fine.
if still need use bottom-edge gesture here options have (as far know):
- you can hide status bar (
uistatusbar
): in case code work expected. having status bar hidden, control center not showing automatically. instead small arrow displayed @ bottom edge giving users possibility open settings if want to. should careful 'cause according apple's guidelines:
think twice before permanently hiding status bar.
- you can ask users disable control center in ios settings. but, guess, annoyed must such hard work :(
hope info useful.
Comments
Post a Comment