ios摇一摇

-(void) motionBegan:(UIEventSubtype)motion withEvent:(UIEvent *)event

{

    if (motion==UIEventSubtypeMotionShake)

        NSLog(@"Shake begin");

}

-(void) motionEnded:(UIEventSubtype)motion withEvent:(UIEvent *)event

{

    if (motion==UIEventSubtypeMotionShake)

        NSLog(@"Shaked");

}

-(void) motionCancelled:(UIEventSubtype)motion withEvent:(UIEvent *)event

{

    if (motion==UIEventSubtypeMotionShake)

        NSLog(@"Shake cancel");

}

posted @ 2015-04-24 17:44  朋克  阅读(138)  评论(0编辑  收藏  举报