How to cache Contacts in iOS?

I want to check if my code to cache contacts data while my iOS app is running is done well or not. Anyone have any samples I can look at. I did a search on the internet and cannot find much. Maybe code to cache any time of cache would help for me to look at. I am using Xcode 13.4.1, and my app is intended to install on iOS 12.0 up to the most current iOS version. I seem to remember a search class in one of Apple's frameworks for iOS. I don't remember if that was part of the Contacts Framework. I also will have a cache for the Contacts data that I store in CloudKit, so I take that into account to be looking for any way that might make the Contacts cache and the CloudKit cache work together.

How to cache Contacts in iOS?
 
 
Q