Skip to content
This repository has been archived by the owner on Aug 29, 2024. It is now read-only.

Added NotificationCenter post when keys have finished synchronization #36

Merged
merged 1 commit into from
Apr 19, 2019
Merged

Conversation

twostraws
Copy link
Contributor

This adds support for applications being notified when Zephyr has finished synchronizing iCloud changes. It's done with two changes:

  1. It adds a static keysDidChangeOnCloudNotification notification name that anyone can observe.

  2. It posts that notification in the keysDidChangeOnCloud() method when synchronization has finished.

So, if an app wants to be informed when synchronization has completed, they would write code like this:

NotificationCenter.default.addObserver(self, selector: #selector(cloudDataChanged), name: Zephyr.keysDidChangeOnCloudNotification, object: nil)

Unrelated but part of this PR: I've added an import for UIKit at the top – Xcode complains if I don't have this, because there's already an observer for UIApplication.willEnterForegroundNotification and UIApplication comes from UIKit.

@ArtSabintsev
Copy link
Owner

This looks good to me - thank you! I'll merge it and cut a new version when I'm back home this evening.

@ArtSabintsev ArtSabintsev merged commit 6bbef91 into ArtSabintsev:master Apr 19, 2019
@ArtSabintsev
Copy link
Owner

Released as v3.4.0 just now.

Sign up for free to subscribe to this conversation on GitHub. Already have an account? Sign in.
Labels
None yet
Projects
None yet
Development

Successfully merging this pull request may close these issues.

2 participants