I have a question about code in the ShapeEdit sample from Apple.
I their code, as shown below, why did they use FileManager's copyItem method instead of its setUbiquitous method? Didn't the documentation say explicitly to use setUbiquitous method?
NSFileCoordinator().coordinate(with: [readIntent, writeIntent], queue: self.coordinationQueue) { error in
if error != nil {
return
}
do {
try fileManager.copyItem(at: readIntent.url, to: writeIntent.url)
try (writeIntent.url as NSURL).setResourceValue(true, forKey: URLResourceKey.hasHiddenExtensionKey)
OperationQueue.main.addOperation {
self.openDocumentAtURL(writeIntent.url)
}
}
catch {
fatalError("Unexpected error during trivial file operations: \(error)")
}
}