Skip to content

Instantly share code, notes, and snippets.

@faizy-ahmed
Last active May 23, 2023 11:35
Show Gist options
  • Save faizy-ahmed/bbbd0408ccc629381c057fa8b061852a to your computer and use it in GitHub Desktop.
Save faizy-ahmed/bbbd0408ccc629381c057fa8b061852a to your computer and use it in GitHub Desktop.
To check if a UIViewController is currently visible.
extension UIViewController {
func isVisible() -> Bool {
return self.isViewLoaded() && self.view.window != nil
}
}
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment