ios - Shake doesn't work when alert is shown -
i implemented shake gesture event. when shake occurs stuff.
however if alert shown don't event.
here have:
- (void)viewdidappear:(bool)animated{ [super viewdidappear:yes]; // register shake detection [self becomefirstresponder]; } - (bool) canbecomefirstresponder{ return yes; } - (void)motionended:(uieventsubtype)motion withevent:(uievent *)event { if (motion == uieventsubtypemotionshake){ dlog(@"shake ended"); } }
is possible shake gesture when alert shown ?
try
- (void)motionended:(uieventsubtype)motion withevent:(uievent *)event { if ( event.subtype == uieventsubtypemotionshake ) { // put in code here handle shake } if ( [super respondstoselector:@selector(motionended:withevent:)] ) [super motionended:motion withevent:event]; } - (bool)canbecomefirstresponder { return yes; }
Comments
Post a Comment