diff --git a/SwiftyDrop/Drop.swift b/SwiftyDrop/Drop.swift index 320582a..06a543f 100644 --- a/SwiftyDrop/Drop.swift +++ b/SwiftyDrop/Drop.swift @@ -73,7 +73,7 @@ public final class Drop: UIView { self.duration = duration scheduleUpTimer(duration) - NotificationCenter.default.addObserver(self, selector: #selector(UIApplicationDelegate.applicationDidEnterBackground(_:)), name: NSNotification.Name.UIApplicationDidEnterBackground, object: nil) + NotificationCenter.default.addObserver(self, selector: #selector(self.applicationDidEnterBackground(_:)), name: NSNotification.Name.UIApplicationDidEnterBackground, object: nil) } override init(frame: CGRect) { @@ -89,7 +89,7 @@ public final class Drop: UIView { NotificationCenter.default.removeObserver(self) } - func applicationDidEnterBackground(_ notification: Notification) { + @objc func applicationDidEnterBackground(_ notification: Notification) { stopUpTimer() removeFromSuperview() }