Skip to content

Commit

Permalink
Set window property on ApplicationService if defined
Browse files Browse the repository at this point in the history
  • Loading branch information
stephanecopin committed May 18, 2017
1 parent 704d2c7 commit 0f35139
Showing 1 changed file with 7 additions and 1 deletion.
Original file line number Diff line number Diff line change
Expand Up @@ -19,7 +19,13 @@ open class PluggableApplicationDelegate: UIResponder, UIApplicationDelegate {

open var services: [ApplicationService] { return [] }
private lazy var __services: [ApplicationService] = {
return self.services
let services = self.services
for service in (services as! [NSObject]) {
if service.responds(to: #selector(setter: UIApplicationDelegate.window)) {
service.perform(#selector(setter: UIApplicationDelegate.window), with: self.window)
}
}
return services
}()

@available(iOS 2.0, *)
Expand Down

0 comments on commit 0f35139

Please sign in to comment.