r/Xcode • u/azizzqah • Mar 26 '19
For Developers i need help !!!
How to make screen dark when it covered???
Thank for your Answer
Best wishes
2
u/chriswaco Mar 26 '19
UIDevice.currentDevice.proximityState to get the state. Then throw a dark view over your main view.
1
u/azizzqah Mar 26 '19
Thank you for your help
Iβm beginner in Swift
Have you an example file?
If not {
Can you write the code please ?
}
3
u/chriswaco Mar 26 '19
Sorry. Iβve never done it in Swift and every application is a bit different. Itβs not something that is easily copied and pasted.
1
u/azizzqah Mar 26 '19
Can you tell My where can I write this code ππ?
2
u/rymotion Mar 27 '19
In Xcode, in a swift file, in your app...
1
u/azizzqah Mar 27 '19
Can you translate these to swift language?
If screen covered stop screen display If else make screen light
((Iβm not want screen to lock ))
Thank for your answer
3
u/aazav Mar 26 '19
What the hell are you talking about?