Find centralized, trusted content and collaborate around the technologies you use most.
Teams
Q&A for work
Connect and share knowledge within a single location that is structured and easy to search.
我目前正在对我的应用程序进行更新 3,我想添加摇动 iPhone 并让它进入我的 UITableView 中的随机单元格的功能。我知道 Apple 建议不要做这种手势,但我想添加它或至少尝试一下。
任何帮助,将不胜感激!
用这个
-(void)motionEnded:(UIEventSubtype)motion withEvent:(UIEvent *)event { if(motion == UIEventSubtypeMotionShake) { NSLog(@"Shake"); } } -(BOOL)canBecomeFirstResponder { return YES; }