Check if the device datesettings is automatic in iOS

后端 未结 2 618
闹比i
闹比i 2021-01-05 04:44

Is there a way to check if the device settings for \"date and time\" is set to automatic or not in Swift? And if there is, is there possible to make the User to switch to th

2条回答
  •  無奈伤痛
    2021-01-05 05:05

    You can use this tool https://github.com/instacart/TrueTime.swift to get a synchronized time.

    If you really want to ask the user, then you can compare the synchronized date to current date Date(). If the date is very different then you can ask the user to check settings.

提交回复
热议问题