Sunday, November 6, 2022

[FIXED] How to get changed contacts using Contacts Framework in iOS

Issue

I can monitor contacts change using:

NotificationCenter.default.addObserver(
            self, selector: #selector(contactStoreDidChange), name: .CNContactStoreDidChange, object: nil)
    }

@objc func contactStoreDidChange(notification: NSNotification) {

}

But how can I get the changed contacts from the notification? Things like which contact is added/removed/changed etc?


Solution

You just can get notify in the method.and you have to then refetch all objects and create your dataSource again for updated data!!



Answered By - Tanvi Jain
Answer Checked By - Cary Denson (PHPFixing Admin)

No comments:

Post a Comment

Note: Only a member of this blog may post a comment.