Detectar Orientacion / Orientation Recognizer

override func viewWillTransitionToSize(size: CGSize, withTransitionCoordinator coordinator: UIViewControllerTransitionCoordinator) { if(UIDeviceOrientationIsLandscape(UIDevice.currentDevice().orientation)) { print("landscape") } if(UIDeviceOrientationIsPortrait(UIDevice.currentDevice().orientation)) { print("Portrait") } super.viewWillTransitionToSize(size, withTransitionCoordinator: coordinator) }

Be the first to comment

You can use [html][/html], [css][/css], [php][/php] and more to embed the code. Urls are automatically hyperlinked. Line breaks and paragraphs are automatically generated.