34,333
edits
Changes
m
Text replacement - "<table border="0" cellspacing="0">" to "<table border="0" cellspacing="0" width="100%">"
<googlehtmlet>BUY_IOS9ios9</googlehtmlet>
Once the CKSubscription is fully configured, it is committed to the cloud database using the saveSubscription method of the cloud database object. For the purposes of this example, the code to implement the subscription should be implemented in the viewDidLoad method located in the ViewController.swift file:
<googlehtmlet>BUY_IOS9ios9</googlehtmlet>
<pre>
override func viewDidLoad() {
The method begins by obtaining a reference to the root view controller of the application. The code then extracts the CKNotification object from the NSDictionary that was passed to the method by the operating system. The notificationType property of the CKNotification object is then checked to make sure it matches CKNotificationType.Query (which indicates that the notification was triggered as a result of a subscription).
<googlehtmlet>BUY_IOS9ios9</googlehtmlet>
The record ID is then obtained and passed to the fetchRecord method on the view controller. The next step is to implement the fetchRecord method.
<googlehtmlet>BUY_IOS9ios9</googlehtmlet>
<htmlet>ezoicbottom</htmlet>
<hr>
<table border="0" cellspacing="0" width="100%">