3
是否有任何代碼可以使我的應用程序在我按下按鈕時平滑振動。目前我正在使用以下方法。請看看ios中的平滑觸摸
-(IBAction)buttonClicked:(UIButton *)sender
{
//AudioServicesPlaySystemSound(kSystemSoundID_Vibrate);
AudioServicesPlayAlertSound (1105);
self.view.userInteractionEnabled = NO;
[[HelperClass shared]playSound:@"single_click_12"];
[HelperClass showBounceAnimatedButton:sender completionBlock:^{
self.view.userInteractionEnabled = YES;
selectedIndex =(int) sender.tag;
[self performSelector:@selector(pushTheViewToGame) withObject:nil afterDelay:0.6];
}];
// NSLog(@"Sender Tag :%li",(long)sender.tag);
}
http://stackoverflow.com/questions/12966467/are-there-apis-for-custom-vibrations-in-ios? – Larme
AudioServicesPlaySystemSound(kSystemSoundID_Vibrate); 請在這行代碼,然後嘗試:) –