문제

What I would like to do is simply make the iDevice fade the screen to black one the proximityState returns yes. However, I am not sure of how to enable it, or monitor it. Would someone be able to simply provide syntax of enabling and monitoring proximityState? The help would be highly appreciated for a new programmer like me.

Thanks! -Jake

도움이 되었습니까?

해결책

You need to use the [UIDevice currentDevice] singleton. First set proximityMonitoringEnabled to YES. Then, you can access the proximity information through the proximityState property. Subscribe to changes to the proximity state by observing the UIDeviceProximityStateDidChangeNotification notification.

라이센스 : CC-BY-SA ~와 함께 속성
제휴하지 않습니다 StackOverflow
scroll top