Disable iPhone vibrate with Setting Bundle [iPhone SDK]
i build an app, now i want disable my shaking with setting bundle when iphone is shaking and vibrating
AudioServicesPlaySystemSound(kSystemSoundID_Vibrate);
Setting Bundle :
Title: Vibrate //// Key : dis_vib//// Type :开发者_开发知识库 PSToggleSwitchSpecifier
Before you call the vibration code, check to see what the NSUserDefaults say.
For example:
if ([[NSUserDefaults standardUserDefaults] boolForKey:@"ShouldVibrate"]){
//Vibrate code
}
Where "ShouldVibrate" is what the settings bundle is setting.
精彩评论