Skip to content

Instantly share code, notes, and snippets.

@zenangst
Last active April 18, 2018 08:25
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 zenangst/83bc3109e95baf4e3a15a13801b13089 to your computer and use it in GitHub Desktop.
Save zenangst/83bc3109e95baf4e3a15a13801b13089 to your computer and use it in GitHub Desktop.
How to rotate tvOS into portrait mode - Example 2
let frame = CGRect(x: 0, y: 0, width: UIScreen.main.bounds.height, height: UIScreen.main.bounds.width)
let window = UIWindow(frame: frame)
let transformRotation = CGAffineTransform(rotationAngle: CGFloat(-270) * .pi / 180)
window.transform = transformRotation
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment