我经常在此站点上访问,但无法完全找到此问题的答案。
我有一个var spreadsheet: BRAOfficeDocumentPackage?
-该类提供了一种“保存”方法,该方法可以有效地编写XML文件,然后对其进行压缩(xlxs格式)。
是否可以使用UIDocument以便利用iCloud集成?诸如此类(用于类型方法的内容):
var spreadsheet: BRAOfficeDocumentPackage?
override func contents(forType typeName: String) throws -> Any {
// saving to file
let fullPath = self.fileURL.absoluteString
if let sheet = spreadsheet {
// this creates an XML file then compresses it
sheet.save(as: fullPath)
}
// how to sync here?
// syncing the file using FileWrapper to the fileURL?
let file = try? FileWrapper(url: fileURL, options: .withoutMapping)
return file as Any
}