How to initialize CKS subscription in iOS 10.3

I am creating an application that needs to subscribe to record changes in iCloud public database. Now after watching Apple videos and reading their documentation, I decided to work. However, I immediately got stuck here:

enter image description here

All initialization methods on CKSubScription have been deprecated. This can be seen here , but meanwhile apple still seems to use the exact same techniques in its documentation here .

This surprised me. Looking around the internet and SO there seems to be too little information or tutorials of any kind (at least not one update on subscription initiation), probably because this technology is relatively new and these changes are the latest. I have very shallow experience with CloudKit, so I would ask for a decent way to do this than improvise myself. My question is:

How do I initialize a CKS subscription?

Obviously, if the whole idea of ​​signing up is out of date, I'm open to any answer that would cause my app to receive clicks when certain types of records appear in my public database.

+3


source to share


1 answer


It seems to be CKSubscription

really more or less out of date.

According to http://iosdevetips.blogspot.de/2016/06/deprecated-apis-in-ios-10.html you should now be using CKRecordZoneSubscription

and CKQuerySubscription

.




Update: As Travis pointed out, the docs here aren't very helpful, but at least Xcode shows a few helpful Warning: enter image description here

+5


source







All Articles