Skip to content

Instantly share code, notes, and snippets.

@FabiolaRamirez
Last active March 19, 2019 19:30
Show Gist options
  • Select an option

  • Save FabiolaRamirez/29826512efe39184dd77d5f9eb7fd4b0 to your computer and use it in GitHub Desktop.

Select an option

Save FabiolaRamirez/29826512efe39184dd77d5f9eb7fd4b0 to your computer and use it in GitHub Desktop.
func prepareForDeepLink(dismissScreen:@escaping () -> ()) {
if var topController = UIApplication.shared.keyWindow?.rootViewController {
while let presentedViewController = topController.presentedViewController {
topController = presentedViewController
}
if topController is SFSafariViewController || topController.children.first is CreditSesameWebViewController || topController.children.first is AlertWebViewController {
dismissScreen()
}
}
}
//lo llamo asi:
prepareForDeepLink() { success in
self.dismiss(animated: false, completion: nil)
}
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment