I\'m working on a small iPhone app, and I am using NSUserDefaults as my data persistence. It only has to keep track of a few things, such as some names and som
NSUserDefaults
In Swift3, I have used in this way
var hasAddedGeofencesAtleastOnce: Bool { get { return UserDefaults.standard.object(forKey: "hasAddedGeofencesAtleastOnce") != nil } }
The answer is great if you are to use that multiple times.
I hope it helps :)