Skip to content

Instantly share code, notes, and snippets.

@meyusufdemirci
Last active January 30, 2018 18:31
Show Gist options
  • Save meyusufdemirci/e403d85a03391b0f15fbf9f983656bc1 to your computer and use it in GitHub Desktop.
Save meyusufdemirci/e403d85a03391b0f15fbf9f983656bc1 to your computer and use it in GitHub Desktop.
@objc func onRotated() {
// portrait
if UIDeviceOrientationIsPortrait(UIDevice.current.orientation) {
playerController.view.frame = CGRect(x: 0, y: 200, width: UIScreen.main.bounds.width, height: 250)
}
// landscape
else if UIDeviceOrientationIsLandscape(UIDevice.current.orientation) {
playerController.view.frame = CGRect(x: 0, y: 0, width: UIScreen.main.bounds.width, height: UIScreen.main.bounds.height)
}
}
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment