Commit 1c0ad9a1 by Rob Jonson

document Application.shared

parent 38ff84be
...@@ -32,6 +32,8 @@ import UIKit ...@@ -32,6 +32,8 @@ import UIKit
public struct Application { public struct Application {
/// A reference to UIApplication.shared application which doesn't trigger linker errors when Material is included in an extension
/// Note that this will crash if actually called from within an extension
public static var shared: UIApplication { public static var shared: UIApplication {
let sharedSelector = NSSelectorFromString("sharedApplication") let sharedSelector = NSSelectorFromString("sharedApplication")
guard UIApplication.responds(to: sharedSelector) else { guard UIApplication.responds(to: sharedSelector) else {
......
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