Application: pass AppDelegate in initializer, instead of using singleton

This commit is contained in:
Andrew Breckenridge
2023-09-27 11:35:41 -07:00
committed by Stefan Ceriu
parent ee0539f260
commit 718e01f3bc
3 changed files with 16 additions and 21 deletions
@@ -24,12 +24,9 @@ enum AppDelegateCallback {
}
class AppDelegate: NSObject, UIApplicationDelegate {
private(set) static var shared: AppDelegate!
let callbacks = PassthroughSubject<AppDelegateCallback, Never>()
func application(_ application: UIApplication, didFinishLaunchingWithOptions launchOptions: [UIApplication.LaunchOptionsKey: Any]? = nil) -> Bool {
// worst singleton ever
Self.shared = self
NSTextAttachment.registerViewProviderClass(PillAttachmentViewProvider.self, forFileType: InfoPlistReader.main.pillsUTType)
return true
}