控制器1:
#import "ViewController.h"
#import <CoreMotion/CoreMotion.h>//核心运动框架
@interface ViewController ()
{
NSTimer *updateTimer;//更新时间
}
//运动管理器
@property (strong, nonatomic) CMMotionManager *motionManager;
//加速度计的标签
@property (strong, nonatomic) IBOutlet UILabel *accelerometerLabel;
//陀螺的标签
@property (strong, nonatomic) IBOutlet UILabel *gyroLabel;
//磁强计标签
@property (strong,