gpt4 book ai didi

ios - iPhone 不振动

转载 作者:行者123 更新时间:2023-11-28 07:37:54 24 4
gpt4 key购买 nike

我正在为 iPhone 振动使用以下源代码。但它在 iPhone 6s 设备上不起作用。谁能指导我在 ios swift 中完成这项任务

extension UIDevice {
static func vibrate() {
AudioServicesPlaySystemSound(kSystemSoundID_Vibrate)
}
}

@objc func sos_Tapped(sender: UIButton!) {
UIDevice.vibrate()
}

最佳答案

既然你提到了 iPhone 6s。你真的应该考虑使用 UIFeedbackGenerator实现这一目标。

关于ios - iPhone 不振动,我们在Stack Overflow上找到一个类似的问题: https://stackoverflow.com/questions/52928232/

24 4 0
Copyright 2021 - 2024 cfsdn All Rights Reserved 蜀ICP备2022000587号
广告合作:1813099741@qq.com 6ren.com