Last active
August 29, 2015 14:21
-
-
Save rshev/fbc9e21b575417263d36 to your computer and use it in GitHub Desktop.
Revisions
-
rshev revised this gist
May 20, 2015 . 1 changed file with 5 additions and 0 deletions.There are no files selected for viewing
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters. Learn more about bidirectional Unicode charactersOriginal file line number Diff line number Diff line change @@ -40,3 +40,8 @@ public extension NSObject{ override func shouldAutorotate() -> Bool { return false } override func viewWillLayoutSubviews() { UIApplication.sharedApplication().setStatusBarHidden(false, withAnimation: UIStatusBarAnimation.None) } -
rshev renamed this gist
May 20, 2015 . 1 changed file with 0 additions and 0 deletions.There are no files selected for viewing
File renamed without changes. -
rshev renamed this gist
May 20, 2015 . 1 changed file with 0 additions and 0 deletions.There are no files selected for viewing
File renamed without changes. -
rshev revised this gist
May 20, 2015 . No changes.There are no files selected for viewing
-
rshev created this gist
May 20, 2015 .There are no files selected for viewing
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters. Learn more about bidirectional Unicode charactersOriginal file line number Diff line number Diff line change @@ -0,0 +1,42 @@ //AppDelegate: func application(application: UIApplication, supportedInterfaceOrientationsForWindow window: UIWindow?) -> Int { var presentedVC = application.keyWindow?.rootViewController while let pVC = presentedVC?.presentedViewController { presentedVC = pVC } if let pVC = presentedVC { if contains(["MPInlineVideoFullscreenViewController", "MPMoviePlayerViewController", "AVFullScreenViewController"], pVC.nameOfClass) { return Int(UIInterfaceOrientationMask.AllButUpsideDown.rawValue) } } return Int(UIInterfaceOrientationMask.Portrait.rawValue) } //Extension: public extension NSObject{ public class var nameOfClass: String{ return NSStringFromClass(self).componentsSeparatedByString(".").last! } public var nameOfClass: String{ return NSStringFromClass(self.dynamicType).componentsSeparatedByString(".").last! } } //View controller: override func supportedInterfaceOrientations() -> Int { return Int(UIInterfaceOrientationMask.Portrait.rawValue) } override func preferredInterfaceOrientationForPresentation() -> UIInterfaceOrientation { return UIInterfaceOrientation.Portrait } override func shouldAutorotate() -> Bool { return false }