Guest User

Untitled

a guest
Oct 21st, 2017
84
0
Never
Not a member of Pastebin yet? Sign Up, it unlocks many cool features!
text 0.56 KB | None | 0 0
  1. func demoVC() -> DemoVC {
  2. let navVC = tabBarVC.viewControllers?[2] as! UINavigationController
  3. return navVC.viewControllers.first as! DemoVC
  4. }
  5.  
  6. func logout() {
  7. if let tabBarVC = tabBarVC {
  8. let vc = tabBarVC.storyboard?.instantiateViewController(withIdentifier: "WelcomeVC")
  9. UIApplication.shared.keyWindow?.rootViewController = vc
  10. //socket close
  11. SocketManager.sharedInstance.logoutFromWebSocket()
  12.  
  13. //remove purshases
  14. KeychainManager.sharedInstance.removeAll()
  15. }
  16. }
Add Comment
Please, Sign In to add comment