美文网首页
iOS编程 摇一摇 震动

iOS编程 摇一摇 震动

作者: 静花寒 | 来源:发表于2015-12-23 10:33 被阅读165次

    #import"ViewController.h"

    #import

    @interfaceViewController()

    @end

    @implementationViewController

    - (void)viewDidLoad {

    [superviewDidLoad];

    // Do any additional setup after loading the view, typically from a nib.

    }

    - (void)touchesBegan:(nonnullNSSet *)touches withEvent:(nullableUIEvent*)event

    {

    AudioServicesPlaySystemSound(kSystemSoundID_Vibrate);

    }

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

    {

    NSLog(@"begin motion");

    }

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

    {

    NSLog(@"end motion");

    }

    - (void)didReceiveMemoryWarning {

    [superdidReceiveMemoryWarning];

    // Dispose of any resources that can be recreated.

    }

    @end

    相关文章

      网友评论

          本文标题: iOS编程 摇一摇 震动

          本文链接:https://www.haomeiwen.com/subject/xdkvhttx.html