Skip to content

Instantly share code, notes, and snippets.

@KrauserHuang
Created March 29, 2021 08:58
Show Gist options
  • Save KrauserHuang/842e9eeb15aaaedeac37f764c4e23c28 to your computer and use it in GitHub Desktop.
Save KrauserHuang/842e9eeb15aaaedeac37f764c4e23c28 to your computer and use it in GitHub Desktop.
@IBAction func logoutPressed(_ sender: UIButton) {
// 畫面顯示怪怪的,再確認
do {
try Auth.auth().signOut()
// navigationController?.popToRootViewController(animated: true)
var rootVC = self.presentingViewController
while let parent = rootVC?.presentingViewController {
rootVC = parent
}
rootVC?.dismiss(animated: true, completion: nil)
print("logout success!")
} catch let signOutError as NSError {
print ("Error signing out: %@", signOutError)
}
}
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment