Guest User

Untitled

a guest
Feb 13th, 2018
101
0
Never
Not a member of Pastebin yet? Sign Up, it unlocks many cool features!
text 0.46 KB | None | 0 0
  1. @objc func onRotated() {
  2.  
  3. // portrait
  4. if UIDeviceOrientationIsPortrait(UIDevice.current.orientation) {
  5. playerController.view.frame = CGRect(x: 0, y: 200, width: UIScreen.main.bounds.width, height: 250)
  6. }
  7.  
  8. // landscape
  9. else if UIDeviceOrientationIsLandscape(UIDevice.current.orientation) {
  10. playerController.view.frame = CGRect(x: 0, y: 0, width: UIScreen.main.bounds.width, height: UIScreen.main.bounds.height)
  11. }
  12. }
Add Comment
Please, Sign In to add comment