UserDefaults can be a useful tool to store small amounts of information. In this
tutorial I will show you how you can store a Date in UserDefaults using Swift.
Storing a date in UserDefaults
Below is the code that we will use to save the date:
let defaults = UserDefaults.standard