Commit 5bbb8555 by Daniel Dahan

added public to static properties in Application struct

parent 0ba48212
...@@ -32,32 +32,32 @@ import UIKit ...@@ -32,32 +32,32 @@ import UIKit
public struct Application { public struct Application {
/// An optional reference to the main UIWindow. /// An optional reference to the main UIWindow.
static var keyWindow: UIWindow? { public static var keyWindow: UIWindow? {
return UIApplication.shared.keyWindow return UIApplication.shared.keyWindow
} }
/// An optional reference to the top most view controller. /// An optional reference to the top most view controller.
static var rootViewController: UIViewController? { public static var rootViewController: UIViewController? {
return keyWindow?.rootViewController return keyWindow?.rootViewController
} }
/// A boolean indicating if the device is in Landscape mode. /// A boolean indicating if the device is in Landscape mode.
static var isLandscape: Bool { public static var isLandscape: Bool {
return UIApplication.shared.statusBarOrientation.isLandscape return UIApplication.shared.statusBarOrientation.isLandscape
} }
/// A boolean indicating if the device is in Portrait mode. /// A boolean indicating if the device is in Portrait mode.
static var isPortrait: Bool { public static var isPortrait: Bool {
return !isLandscape return !isLandscape
} }
/// The current UIInterfaceOrientation value. /// The current UIInterfaceOrientation value.
static var orientation: UIInterfaceOrientation { public static var orientation: UIInterfaceOrientation {
return UIApplication.shared.statusBarOrientation return UIApplication.shared.statusBarOrientation
} }
/// Retrieves the device status bar style. /// Retrieves the device status bar style.
static var statusBarStyle: UIStatusBarStyle { public static var statusBarStyle: UIStatusBarStyle {
get { get {
return UIApplication.shared.statusBarStyle return UIApplication.shared.statusBarStyle
} }
...@@ -67,7 +67,7 @@ public struct Application { ...@@ -67,7 +67,7 @@ public struct Application {
} }
/// Retrieves the device status bar hidden state. /// Retrieves the device status bar hidden state.
static var isStatusBarHidden: Bool { public static var isStatusBarHidden: Bool {
get { get {
return UIApplication.shared.isStatusBarHidden return UIApplication.shared.isStatusBarHidden
} }
...@@ -80,12 +80,12 @@ public struct Application { ...@@ -80,12 +80,12 @@ public struct Application {
A boolean that indicates based on iPhone rules if the A boolean that indicates based on iPhone rules if the
status bar should be shown. status bar should be shown.
*/ */
static var shouldStatusBarBeHidden: Bool { public static var shouldStatusBarBeHidden: Bool {
return isLandscape && .phone == Device.userInterfaceIdiom return isLandscape && .phone == Device.userInterfaceIdiom
} }
/// A reference to the user interface layout direction. /// A reference to the user interface layout direction.
static var userInterfaceLayoutDirection: UIUserInterfaceLayoutDirection { public static var userInterfaceLayoutDirection: UIUserInterfaceLayoutDirection {
return UIApplication.shared.userInterfaceLayoutDirection return UIApplication.shared.userInterfaceLayoutDirection
} }
} }
...@@ -49,8 +49,8 @@ internal extension UIViewController { ...@@ -49,8 +49,8 @@ internal extension UIViewController {
} }
/** /**
Retrieves a flattened hierarchy of view controllers for a given type. Traverses the child view controllers to find the correct view controller type T.
- Returns: An Array of type T. - Returns: An optional of type T.
*/ */
func traverseTransitionViewControllerHierarchyForClassType<T: UIViewController>() -> T? { func traverseTransitionViewControllerHierarchyForClassType<T: UIViewController>() -> T? {
if let v = self as? T { if let v = self as? T {
......
Markdown is supported
0% or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment