Advertisement
Not a member of Pastebin yet?
Sign Up,
it unlocks many cool features!
- extension UIViewController {
- func supportedInterfaceOrientations() -> UIInterfaceOrientationMask {
- if let nvc = self as? UINavigationController {
- return nvc.topViewController!.supportedInterfaceOrientations()
- } else {
- return .Portrait
- }
- }
- func shouldAutorotate() -> Bool {
- if let nvc = self as? UINavigationController {
- return nvc.topViewController!.shouldAutorotate()
- } else {
- return false
- }
- }
- func preferredInterfaceOrientationForPresentation() -> UIInterfaceOrientation {
- if let nvc = self as? UINavigationController {
- return nvc.topViewController!.preferredInterfaceOrientationForPresentation()
- } else {
- return .Portrait
- }
- }
- }
Advertisement
Add Comment
Please, Sign In to add comment
Advertisement