jjzjj

accThreshold

全部标签

ios - UILabel 不会更新核心运动闭包内调用的文本

每次摇动设备时,我都试图更改UILabel的文本。我需要一些解决方法来捕捉比UIEventSubtype抖动更频繁的抖动。motionMethod被调用,尽管我的UILabel的文本在它最终更新之前保持不变几秒钟。这是我的代码:letdelegate=(UIApplication.sharedApplication().delegateasAppDelegate)varplayer:Player!varmotionManager:CMMotionManager?letaccThreshold=1.0varreferenceTime=NSDate()lettimeThreshold=0.