Skip to content

Instantly share code, notes, and snippets.

@KrauserHuang
Created March 24, 2022 07:44
Show Gist options
  • Save KrauserHuang/c7a89c1f878de383e9a12f980cd1fab8 to your computer and use it in GitHub Desktop.
Save KrauserHuang/c7a89c1f878de383e9a12f980cd1fab8 to your computer and use it in GitHub Desktop.
func scene(_ scene: UIScene, openURLContexts URLContexts: Set<UIOpenURLContext>) {
// 紀錄url scheme
print(URLContexts)
guard let url = URLContexts.first?.url else{return}
urlScheme(url.absoluteString)
}
func urlScheme(_ urlStr: String){
let root = UIApplication.shared.windows.first?.rootViewController as? RootTabBarController
let navi = root?.selectedViewController as? UINavigationController
navi?.popToRootViewController(animated: true)
}
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment