Skip to content

Commit

Permalink
Added public property window to ApplicationService extension
Browse files Browse the repository at this point in the history
  • Loading branch information
ismetanin committed Sep 2, 2017
1 parent e03cd1e commit 53ea914
Showing 1 changed file with 10 additions and 0 deletions.
Original file line number Diff line number Diff line change
Expand Up @@ -13,6 +13,16 @@ import CloudKit
/// It doesn't add more functionalities yet.
public protocol ApplicationService: UIApplicationDelegate {}

extension ApplicationService {
@nonobjc public var window: UIWindow? {
get {
return UIApplication.shared.delegate?.window ?? nil
} set(newValue) {
(UIApplication.shared.delegate as? PluggableApplicationDelegate)?.window = newValue
}
}
}

open class PluggableApplicationDelegate: UIResponder, UIApplicationDelegate {

public var window: UIWindow?
Expand Down

0 comments on commit 53ea914

Please sign in to comment.