SHARE
TWEET

Untitled

a guest Jun 16th, 2019 63 Never
Not a member of Pastebin yet? Sign Up, it unlocks many cool features!
  1. -save id to the user default by using login button
  2. let id = UserDefaults.standard
  3. id.set(data.id , forKey : "ID")
  4. id.synchronize
  5. - using user id with this code in diferent pages
  6. let user_id = UserDefaults.standard.integer(forKey : "ID")
  7. - delete id from user default by using logout button
  8. UserDefaults.standard.removeObject(forKey : "ID")
  9. userDefaults.synchronize
  10. let appDelegate = UIApplication.shared.delegate as! AppDelegate
  11. let mainScreen = UIStoryboard.init(name : "Main" , bundle : nil).instantiateViewController(withIdentifier :"BG")
  12. appDelegate.window?.rootViewController =   mainScreen
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