add animations back to empty cell on foreground. fixes #108

This commit is contained in:
Ryan Nystrom
2017-07-12 15:26:18 -04:00
parent 0ce1b59e61
commit dba53bf00c
2 changed files with 10 additions and 2 deletions

View File

@@ -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

View File

@@ -32,7 +32,7 @@
</dict>
</array>
<key>CFBundleVersion</key>
<string>733</string>
<string>735</string>
<key>ITSAppUsesNonExemptEncryption</key>
<false/>
<key>LSApplicationQueriesSchemes</key>