search

Home  >  Q&A  >  body text

objective-c - iOS 中时如何判断保存的密码是否过期

账户和密码是用keychain保存,假设需求 是三十天未登录 让其重新输入账户名和密码 不是直接登录

阿神阿神2889 days ago475

reply all(2)I'll reply

  • PHP中文网

    PHP中文网2017-04-17 17:38:18

    Use NSUserDefault to save a timestamp
    Then every time you open the APP, just judge the time difference between the current timestamp and the saved timestamp

    reply
    0
  • 怪我咯

    怪我咯2017-04-17 17:38:18

    nsdate gets the current date, and then subtracts it from the cached nsdate of the current day

    reply
    0
  • Cancelreply