Advertisement
Not a member of Pastebin yet?
Sign Up,
it unlocks many cool features!
- -save id to the user default by using login button
- let id = UserDefaults.standard
- id.set(data.id , forKey : "ID")
- id.synchronize
- - using user id with this code in diferent pages
- let user_id = UserDefaults.standard.integer(forKey : "ID")
- - delete id from user default by using logout button
- UserDefaults.standard.removeObject(forKey : "ID")
- userDefaults.synchronize
- let appDelegate = UIApplication.shared.delegate as! AppDelegate
- let mainScreen = UIStoryboard.init(name : "Main" , bundle : nil).instantiateViewController(withIdentifier :"BG")
- appDelegate.window?.rootViewController = mainScreen
Advertisement
Add Comment
Please, Sign In to add comment
Advertisement