Skip to content

Instantly share code, notes, and snippets.

@hashaam
Last active August 31, 2017 11:24
Show Gist options
  • Star 0 You must be signed in to star a gist
  • Fork 0 You must be signed in to fork a gist
  • Save hashaam/836d5b67a1d42343376c39d55e9ff1fb to your computer and use it in GitHub Desktop.
Save hashaam/836d5b67a1d42343376c39d55e9ff1fb to your computer and use it in GitHub Desktop.
Using UIWindow Presentation Context
// https://hashaam.com/2017/08/31/uiwindow-presentation-context/
if let delegate = UIApplication.shared.delegate, let window = delegate.window, let viewController = window?.presentationContext() {
// perform action on viewController
}
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment