Skip to content

Instantly share code, notes, and snippets.

@gahntpo
Created June 20, 2020 08:34
Show Gist options
  • Star 1 You must be signed in to star a gist
  • Fork 0 You must be signed in to fork a gist
  • Save gahntpo/8dfe2692bbfd52aabde43472dbcbef93 to your computer and use it in GitHub Desktop.
Save gahntpo/8dfe2692bbfd52aabde43472dbcbef93 to your computer and use it in GitHub Desktop.
using the call to WindowScene( didUpdate) to access the window size and device orientation
func windowScene(_ windowScene: UIWindowScene,
didUpdate previousCoordinateSpace: UICoordinateSpace,
interfaceOrientation previousInterfaceOrientation: UIInterfaceOrientation,
traitCollection previousTraitCollection: UITraitCollection) {
// windowScene.coordinateSpace.bounds
// windowScene.interfaceOrientation.isLandscape
}
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment