任何人使用帶有Swift的iRareMedia iCloudDocumentSync?我在Objective-C中成功使用了這個框架,但是無法開始使用Swift。在Objective C,應用程序初始化的iCloud下列要求:使用帶有Swift的iRareMedia iCloudDocumentSync
[[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];
我無法弄清楚如何將兩個的這些轉換爲斯威夫特。該類訂閱到iCloudDelegate協議:
class AppDelegate: UIResponder, UIApplicationDelegate, iCloudDelegate {
對於第一
[[iCloud sharedCloud] setDelegate:self];
我試圖iCloud.sharedCloud().setDelegate(self)
但我得到一個編譯器錯誤:無法調用「setDelegate」類型的參數列表「(AppDelegate中)」
我也試過iCloud.sharedCloud().delegate = self
(因爲委託是iCloud中的一個屬性),但我得到了編譯器消息:不明確使用‘代理’
第二[[iCloud sharedCloud] setVerboseLogging:YES];
轉換隻是iCloud.sharedCloud().setVerboseLogging = true
第三[[iCloud sharedCloud] setupiCloudDocumentSyncWithUbiquityContainer:nil];
我已經試過
iCloud.sharedCloud().setupiCloudDocumentSyncWithUbiquityContainer(nil)
這讓我精:類型AnyObject'的值與下錯誤插入符沒有成員「setupiCloudDocumentSyncWithUbiquityContainer」 '共享雲'。
我很困惑。我已經爲Swift方法轉換做了很多Objective-c,所以我對這個遊戲並不是很新鮮,但我無法弄清楚。如果有人在Swift中使用iRareMedia的iCloudDocumentSync框架,我會很感激任何幫助和見解。
謝謝。