 import UIKit
 
 public struct Application {
+    
+  public static var shared: UIApplication {
+    let sharedSelector = NSSelectorFromString("sharedApplication")
+    guard UIApplication.responds(to: sharedSelector) else {
+      fatalError("[Material: Extensions cannot access Application]")
+    }
+    
+    let shared = UIApplication.perform(sharedSelector)
+    return shared?.takeUnretainedValue() as! UIApplication
+  }
+    
   /// An optional reference to the main UIWindow.
   public static var keyWindow: UIWindow? {
-    return UIApplication.shared.keyWindow
+    return Application.shared.keyWindow
   }
   
   /// An optional reference to the top most view controller.

  
  /// A boolean indicating if the device is in Landscape mode.
  public static var isLandscape: Bool {
    return UIApplication.shared.statusBarOrientation.isLandscape
  }
  
  /// A boolean indicating if the device is in Portrait mode.

  
  /// A reference to the user interface layout direction.
  public static var userInterfaceLayoutDirection: UIUserInterfaceLayoutDirection {
    return Application.shared.userInterfaceLayoutDirection
  }
}
