このライブラリ
https://github.com/iRareMedia/iCloudDocumentSync
のsaveAndCloseDocumentWithNameメソッドをswiftで書く方法を教えて下さい。
objective-c
[[iCloud sharedCloud] saveAndCloseDocumentWithName:@"sample.txt" withContent:[NSData data] completion:^(UIDocument *cloudDocument, NSData *documentData, NSError *error) { if (error == nil) { // Code here to use the UIDocument or NSData objects which have been passed with the completion handler } }];
swiftでこんな風に書いてみました
iCloud.sharedCloud().saveAndCloseDocumentWithName("sample.txt", withContent: nil, completion: { (document:UIDocument!, data:NSData!, error:NSError!) -> Void in })
しかし、```ここに言語を入力
Cannot invoke 'saveAndCloseDocumentWithName' with an argument list of type '(String, withContent: nil, completion: (UIDocument!, NSData!, NSError!) -> Void)'
とビルドが通りません。 どう書けばいいでしょうか
バッドをするには、ログインかつ
こちらの条件を満たす必要があります。