before ios 14, I can detect by UIScreen.main.brightness (Can we detect whether a user left through the home button or lock button without listening to darwin notifications?)
But now it doesn't work.
Can I detect whether a user left through the home button or lock button in iOS 14?