Anybody using iRareMedia's iCloudDocumentSync with Swift? I used this framework successfully with Objective-C, but can't get started with Swift. In Objective C, the app initializes iCloud with the following:
[[iCloud sharedCloud] setDelegate:self]; // Set this if you plan to use the delegate
[[iCloud sharedCloud] setVerboseLogging:YES]; // We want detailed feedback about what's going on with iCloud, this is OFF by default
[[iCloud sharedCloud] setupiCloudDocumentSyncWithUbiquityContainer:nil];
I cannot figure out how to convert two of these to Swift. The class is subscribed to the iCloudDelegate protocol:
class AppDelegate: UIResponder, UIApplicationDelegate, iCloudDelegate {
For the first
[[iCloud sharedCloud] setDelegate:self];
I tried iCloud.sharedCloud().setDelegate(self)
but I get a compiler error: Cannot invoke 'setDelegate' with an argument list of type '(AppDelegate)'
I've also tried iCloud.sharedCloud().delegate = self
(since delegate is a property of iCloud), but I get the compiler message: Ambiguous use of 'delegate'
The second [[iCloud sharedCloud] setVerboseLogging:YES];
converts just fine with iCloud.sharedCloud().setVerboseLogging = true
The third [[iCloud sharedCloud] setupiCloudDocumentSyncWithUbiquityContainer:nil];
I've tried
iCloud.sharedCloud().setupiCloudDocumentSyncWithUbiquityContainer(nil)
which gets me: Value of type 'AnyObject' has no member 'setupiCloudDocumentSyncWithUbiquityContainer' with the error caret under the 's' of sharedCloud.
I'm baffled. I've done lots of Objective-c to Swift method conversions, so I'm not exactly new to this game, but I can't figure this out. If anyone is using iRareMedia's iCloudDocumentSync framwork with Swift, I'd appreciate any help and insights.
Thanks.