【发布时间】:2019-11-13 14:49:13
【问题描述】:
我用它来振动我的手机:
AudioServicesPlaySystemSound(kSystemSoundID_Vibrate);
但是,振动太大了。我想稍微振动一下,就像糖果粉碎游戏中移除糖果时的振动效果一样。
【问题讨论】:
-
这可能有帮助吗? stackoverflow.com/a/39957091/5464805
标签: ios cocoa-touch
我用它来振动我的手机:
AudioServicesPlaySystemSound(kSystemSoundID_Vibrate);
但是,振动太大了。我想稍微振动一下,就像糖果粉碎游戏中移除糖果时的振动效果一样。
【问题讨论】:
标签: ios cocoa-touch
试试这个:
let generator = UIImpactFeedbackGenerator(style: .heavy)
generator.impactOccurred()
或对象:
UIImpactFeedbackGenerator *generator = [[UIImpactFeedbackGenerator alloc] initWithStyle:UIImpactFeedbackStyleHeavy];
[generator impactOccurred];
【讨论】: