Created
March 29, 2021 08:58
-
-
Save KrauserHuang/842e9eeb15aaaedeac37f764c4e23c28 to your computer and use it in GitHub Desktop.
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
@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