Finding out if the device is locked, from a Notification Widget
问题 I'd like to know if the device is locked when I'm loading my Notification/Today widget, so I can show the widget appropriately. (it's financial, and we don't want to show balances on a locked phone) On devices with TouchID, I can just try to access the Keychain, and if I get errSecInteractionNotAllowed back, it's locked. All good. This doesn't work on devices without touchID (but with a PIN). I've found a few things, which recommend using [[UIApplication sharedApplication]