Programmatically detect whether iOS passcode is enabled or not

前端 未结 3 656
佛祖请我去吃肉
佛祖请我去吃肉 2020-12-04 13:57

Rather than build a passcode directly into my app and potentially require the user to enter a passcode twice (once for the device and again for my app); I thought I might ou

3条回答
  •  Happy的楠姐
    2020-12-04 14:25

    I'm not aware of any way of getting this information directly, however I think you can probably achieve the result you are after by using side-effects of Apple's support for disk encryption. See Protecting Data Using On-Disk Encryption for details.

    However this is a hack rather than designed behaviour, and there are some corner-cases it won't be aware of. I'd recommend making this feature something that's explicitly under the control of the user rather than something you enable with heuristics.

提交回复
热议问题