Skip to content

Instantly share code, notes, and snippets.

@minsOne
Last active August 29, 2015 14:19
Show Gist options
  • Select an option

  • Save minsOne/6b6da39d40a4c312fb82 to your computer and use it in GitHub Desktop.

Select an option

Save minsOne/6b6da39d40a4c312fb82 to your computer and use it in GitHub Desktop.
override func shouldAutorotate() -> Bool {
return isRotate
}
override func viewWillTransitionToSize(size: CGSize, withTransitionCoordinator coordinator: UIViewControllerTransitionCoordinator) {
if UIDevice.currentDevice().orientation.isLandscape.boolValue {
println("Now Device Orientation is Landscape")
} else {
println("Now Device Orientation is Portrait")
}
coordinator.animateAlongsideTransition({ (context: UIViewControllerTransitionCoordinatorContext!) in
}, completion: { (context: UIViewControllerTransitionCoordinatorContext!) in
println("Rotation is Completion")
})
}
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment