Why does ShapeEdit use FileManager copyItem instead of setUbiquitous?

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)")
                }
            }
im requesting help ... please help like im not able to create file directly at the icloud folder

below is the code

Code Block          
let filemanUrl = FileManager.default.url(forUbiquityContainerIdentifier: nil)?.appendingPathComponent("Documents").appendingPathComponent("String.txt")


i enabled container in signing & capabilities
iCloud.checkitnow

and my files are getting created in
Code Block
Users/<myname>/Library/Developer/CoreSimulator/Devices/A3A4FF34-0942-4B9A-84F3-F4F6F48D4608/data/Library/Mobile%20Documents/iCloud~checkitnow/Documents/String.txt

but could not find the same in icloud documents folder

how to make it happen ?
Why does ShapeEdit use FileManager copyItem instead of setUbiquitous?
 
 
Q