ALL BUSINESS
COMIDA
DIRECTORIES
EDUCATIONAL
ENTERTAINMENT
FASHION TIPS
FINER THINGS
FREE CREATOR TOOLS
HEALTH
MARKETPLACE
MEMBER's ONLY
MONEY MATTER$
MOTIVATIONAL
NEWS & WEATHER
TECHNOLOGIA
TELEVISION NETWORKS
USA VOTES 2024
VIDEOS
INVESTOR RELATIONS
IN DEVELOPMENT
Posted by - Latinos MediaSyndication -
on - May 1, 2023 -
Filed in - Technology -
-
347 Views - 0 Comments - 0 Likes - 0 Reviews
Followed the exact steps here Swift - saving a file to icloud drive
Code
func save() { do { if let containerUrl = FileManager.default.url(forUbiquityContainerIdentifier: nil)?.appendingPathComponent("Documents") { if !FileManager.default.fileExists(atPath: containerUrl.path, isDirectory: nil) { do { try FileManager.default.createDirectory(at: containerUrl, withIntermediateDirectories: true, attributes: nil) } catch { print(error.localizedDescription) } } let fileURL = containerUrl.appendingPathComponent("test2.txt") if FileManager.default.fileExists(atPath: fileURL.path, isDirectory: nil) { try FileManager.default.removeItem(at: fileURL) } try data.write(to: fileURL) print("Drawing saved to \(fileURL)") } } catch { print("Error saving drawing: \(error)") } }
my info.plist
<?xml version="1.0" encoding="UTF-8"?> <!DOCTYPE plist PUBLIC "-//Apple//DTD PLIST 1.0//EN" "http://www.apple.com/DTDs/PropertyList-1.0.dtd"> <plist version="1.0"> <dict> <key>UISupportsDocumentBrowser</key> <true/> <key>NSUbiquitousContainers</key> <dict> <key>iCloud.com.mycompany.TestSketchSave</key> <dict> <key>NSUbiquitousContainerIsDocumentScopePublic</key> <true/> <key>NSUbiquitousContainerName</key> <string>TestSketchSave</string> <key>NSUbiquitousContainerSupportedFolderLevels</key> <string>Any</string> </dict> </dict> </dict> </plist>
iCloud container id is
iCloud.com.mycompany.TestSketchSave
App id is
com.mycompany.TestSketchSave
Files successfully shows up in icloud drive settings
According to the post's answer I have also upgraded the version number of the app.
Still does not show in the File app