Skip to content
This repository has been archived by the owner on May 23, 2022. It is now read-only.

Commit

Permalink
fixing applicationDidEnterBackground issue #59
Browse files Browse the repository at this point in the history
  • Loading branch information
thiagodelmotte committed Nov 7, 2017
1 parent 21b2ae0 commit 42491db
Showing 1 changed file with 2 additions and 2 deletions.
4 changes: 2 additions & 2 deletions SwiftyDrop/Drop.swift
Original file line number Diff line number Diff line change
Expand Up @@ -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) {
Expand All @@ -89,7 +89,7 @@ public final class Drop: UIView {
NotificationCenter.default.removeObserver(self)
}

func applicationDidEnterBackground(_ notification: Notification) {
@objc func applicationDidEnterBackground(_ notification: Notification) {
stopUpTimer()
removeFromSuperview()
}
Expand Down

0 comments on commit 42491db

Please sign in to comment.