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.
是否有可能以编程方式复制 iPhone 的功能,即当手机靠近您的耳朵时屏幕变暗并且触摸功能被关闭?
UIDevice.current.isProximityMonitoringEnabled = true
这应该可以启用接近传感器并在靠近耳朵时自动关闭屏幕