Version 7.0
Major changes in favor of stability and security. iCloud Document Sync is now a singleton. There are numerous new and updated methods. New delegate methods and protocols. New iCloudDocument features. Automated documentation and framework builds for easier contribution. Plus it fixes numerous bugs and adds an iOS Sample app.
Breaking Changes
-
Converted the iCloud class to a singleton. This approach makes iCloud Document Sync easier to maintain, and it increases stability. All class methods are now instance methods that must be called with the iCloud singleton manager:
sharedCloud
. Now when calling a method instead of doing this:[iCloud methodName]
do this instead:[[iCloud sharedCloud] methodName];
-
Removed all deprecated methods and delegate methods from previous versions. Any methods and delegate methods previously marked as deprecated no longer exist. Calling any of those methods will result in a compiler error.
-
Removed the delegate parameters from
uploadLocalOfflineDocumentsWithDelegate:
andupdateFilesWithDelegate:
. These methods have been renamed. Check the documentation for new names. -
The delegate method,
iCloudFilesDidChange: withNewFileNames:
now passes an NSMetadataItem in the first parameter instead of an NSURL object. This provides much more information about a file, but will cause an error if you try to access it as an NSURL. To get the URL from the NSMetadataItem, just call[item valueForAttribute:NSMetadataItemURLKey]
.- Revised iCloudDocument properties, methods, structure, and organization. iCloudDocument can now be used as a singleton also. Plus, many properties and methods have changed - both in name and functionality.
Other Changes
- Created iOS Sample app to demonstrate how to properly use many features of iCloud Document Sync. Also beneficial for testing purposes.
- Added file conflict handling methods. Retrieve a list of conflicting versions of a document, select the correct one, and then submit it for resolution.
- Added document change tracking when saving a file to iCloud. Changes to files are automatically saved when saving a file. You can also explicitly update the change count.
- Added document state monitoring methods. You can now subscribe and unsibscribe from document state changes. Check the state of a document at any time too.
- Added rename document method. Now you can rename documents stored in iCloud.
- Added duplicate document method. Now you can duplicate documents stored in iCloud.
- Added evict document method. Evict a document from iCloud storage (download to local app sandbox and then delete from iCloud) by setting it to not be ubiquitous.
- Added promote document method. Promote a document to iCloud storage (upload from local app sandbox to iCloud) by setting it to be ubiquitous.
- Added new method to submit changes to a document.
- Added new methods for retrieving the current ubiquity directory URL
- Added new methods for retrieving an iCloudDocument object based on a given file name
- Added new methods for retrieving information about a document stored in iCloud (file modified date, creation date, and size)
- New protocol / delegate on the iCloudDocument class. Now you can subscribe to errors with UIDocument.
- New delegate method to specify the iCloud query predicate filter:
iCloudQueryLimitedToFileExtension
- New delegate method to notify you of changes in the availability of iCloud:
iCloudAvailabilityDidChangeToState:withUbiquityToken:withUbiquityContainer:
- New property to enable or disable verbose logging of iCloud Document Sync. Also added a
verboseAvailabilityLogging
property to toggle the display of availability changes in the log. - Made improvements to document saving, now closes instead of overwriting the document. Allowing UIDocument to handle versions and changes.
- Made improvements to the
checkCloudAvailability
method. Now checks for ubiquityIdentityToken instead of the ubiquity container (which was intensive and time consuming). - All methods check for iCloud availability before executing. A method will return prematurely if iCloud is unavailable. Errors are printed in the console.
- Fixed thread management issues and crashes in iCloudDocument.
- Fixed crash when updating the iCloud list.
- Fixed crash on
shareDocumentWithName: completion:
method. - Fixed issues related to thread-management that may have caused crashes in some cases.
- Fixed
x86_64
architecture compile issue. - Improved error reporting.
- Improved exception handling with @Try / @catch blocks.
- Improved thread management.
- Updated Xcode project settings.
- Removed the irrelevant timer code and methods.
- Removed iOS Simulator detection. As of Xcode 5.0, the iOS Simulator works with iCloud.
Issues Resolved
This release resolves the following issues: #3, #5, #11, #14, #17, #18, and #19. Refer to these issues for specifics on some of the fixes included in this release.
Known Issues
When saving, closing, or opening a UIDocument object - the UIDocument class may never call its completion handler or it may take an extended amount of time to call the completion handler. This is believed to be a bug in Apple's APIs (the UIDocument class itself), not iCloud Document Sync. A bug report has been filed with Apple. Radar: rdar://15555843 Open Radar: http://www.openradar.me/15555843
The iCloud Ubiquity Container URL may be nil
when called at some points, causing a crash when generating the iCloud Documents Directory URL.
The save and close document method may not properly close or save documents when called.