From 42491db61ebb6627a79b2696d3eff95166bea24d Mon Sep 17 00:00:00 2001 From: Thiago Delmotte Date: Tue, 7 Nov 2017 19:15:40 -0200 Subject: [PATCH] fixing applicationDidEnterBackground issue #59 --- SwiftyDrop/Drop.swift | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) 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() }