From dba53bf00cfa23ccfb2bc37f01c7ee99a8466f1c Mon Sep 17 00:00:00 2001 From: Ryan Nystrom Date: Wed, 12 Jul 2017 15:26:18 -0400 Subject: [PATCH] add animations back to empty cell on foreground. fixes #108 --- Classes/Notifications/NoNewNotificationsCell.swift | 10 +++++++++- Resources/Info.plist | 2 +- 2 files changed, 10 insertions(+), 2 deletions(-) diff --git a/Classes/Notifications/NoNewNotificationsCell.swift b/Classes/Notifications/NoNewNotificationsCell.swift index c8b5c45f..4386f0af 100644 --- a/Classes/Notifications/NoNewNotificationsCell.swift +++ b/Classes/Notifications/NoNewNotificationsCell.swift @@ -43,6 +43,14 @@ final class NoNewNotificationsCell: UICollectionViewCell { } resetAnimations() + + // CAAnimations will be removed from layers on background. restore when foregrounding. + NotificationCenter.default + .addObserver(self, + selector: #selector(NoNewNotificationsCell.resetAnimations), + name: NSNotification.Name.UIApplicationWillEnterForeground, + object: nil + ) } required init?(coder aDecoder: NSCoder) { @@ -65,7 +73,7 @@ final class NoNewNotificationsCell: UICollectionViewCell { // MARK: Private API - private func resetAnimations() { + @objc private func resetAnimations() { let timingFunction = CAMediaTimingFunction(name: kCAMediaTimingFunctionEaseInEaseOut) let duration: TimeInterval = 1 diff --git a/Resources/Info.plist b/Resources/Info.plist index c4b1920d..dd59edea 100644 --- a/Resources/Info.plist +++ b/Resources/Info.plist @@ -32,7 +32,7 @@ CFBundleVersion - 733 + 735 ITSAppUsesNonExemptEncryption LSApplicationQueriesSchemes