Skip to content

Commit

Permalink
Reanimate FC consent view on app foreground
Browse files Browse the repository at this point in the history
  • Loading branch information
mats-stripe committed Jun 27, 2024
1 parent 86a3c27 commit f284125
Showing 1 changed file with 17 additions and 0 deletions.
Original file line number Diff line number Diff line change
Expand Up @@ -66,6 +66,10 @@ class ConsentViewController: UIViewController {
required init?(coder: NSCoder) {
fatalError("init(coder:) has not been implemented")
}

deinit {
NotificationCenter.default.removeObserver(self)
}

override func viewDidLoad() {
super.viewDidLoad()
Expand Down Expand Up @@ -111,6 +115,19 @@ class ConsentViewController: UIViewController {
// this fixes an issue where presenting a UIViewController
// on top of ConsentViewController would stop the dot animation
consentLogoView?.animateDots()

NotificationCenter.default.addObserver(
self,
selector: #selector(appWillEnterForeground),
name: UIApplication.willEnterForegroundNotification,
object: nil
)
}

@objc private func appWillEnterForeground() {
// Fixes an issue where the dot animation was stopped when the app
// was backgrounded, then reopened.
consentLogoView?.animateDots()
}

private func didSelectAgree() {
Expand Down

0 comments on commit f284125

Please sign in to comment.