daily pastebin goal
74%
SHARE
TWEET

Untitled

a guest Jan 20th, 2018 39 Never
Not a member of Pastebin yet? Sign Up, it unlocks many cool features!
  1. extension UserDefaults {
  2.     @objc dynamic var user: Int {
  3.         return integer(forKey: "user")
  4.     }
  5.     @objc dynamic var expansionPrefix: String? {
  6.         return string(forKey: "prefix")
  7.     }
  8. }
  9. static var onUserChange = UserDefaults.standard.observe(\.user, options: [.initial, .new], changeHandler: { (defaults, change) in
  10.     func listenForEvents() {
  11.         if change.isPrior {
  12.             setMenu(state: .Loading)
  13.             setMenu(state: .MainMenu)
  14.         } else {
  15.             setMenu(state: .Setup)
  16.         }
  17.     }
  18. })
RAW Paste Data
We use cookies for various purposes including analytics. By continuing to use Pastebin, you agree to our use of cookies as described in the Cookies Policy. OK, I Understand
 
Top