Created
January 21, 2017 18:58
-
-
Save vivalalova/9a3664dd7f2637fc7e67550ac6d8dd32 to your computer and use it in GitHub Desktop.
view manager
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 characters
| struct ViewManager { | |
| static let rootViewController = UIApplication.sharedApplication().keyWindow?.rootViewController | |
| static let statusBarHeight = UIApplication.sharedApplication().statusBarFrame.size.height | |
| static var currentWindow: UIWindow? { | |
| if let window = UIApplication.sharedApplication().keyWindow { | |
| return window | |
| } else { | |
| return UIApplication.sharedApplication().windows[0] as? UIWindow | |
| } | |
| } | |
| static func navigationBarHeight(callFrom: UIViewController) - > CGFloat { | |
| return callFrom.navigationController?.navigationBar.frame.size.height ?? 44 | |
| } | |
| } |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment