Skip to content

Commit 201a277

Browse files
committed
Set window property on ApplicationService if defined
1 parent e03cd1e commit 201a277

1 file changed

Lines changed: 7 additions & 1 deletion

File tree

PluggableApplicationDelegate/Classes/ApplicationServicesManager.swift

Lines changed: 7 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -19,7 +19,13 @@ open class PluggableApplicationDelegate: UIResponder, UIApplicationDelegate {
1919

2020
open var services: [ApplicationService] { return [] }
2121
private lazy var __services: [ApplicationService] = {
22-
return self.services
22+
let services = self.services
23+
for service in (services as! [NSObject]) {
24+
if service.responds(to: #selector(setter: UIApplicationDelegate.window)) {
25+
service.perform(#selector(setter: UIApplicationDelegate.window), with: self.window)
26+
}
27+
}
28+
return services
2329
}()
2430

2531
@available(iOS 2.0, *)

0 commit comments

Comments
 (0)