简体   繁体   中英

Swift - How to save a text file from speech

I am working on Speech to Text Application in iOS.

Actually I already made it but my actual problem is when speech is converted in text how can I save the text file in txt in specified location?

guard let path = try? FileManager.default.url(for: .documentDirectory, in: .userDomainMask, appropriateFor: nil, create: false) .appendingPathComponent("Folder/File.txt") else { return } try? "Text".write(to: path, atomically: false, encoding: .utf8)

The technical post webpages of this site follow the CC BY-SA 4.0 protocol. If you need to reprint, please indicate the site URL or the original address.Any question please contact:yoyou2525@163.com.

 
粤ICP备18138465号  © 2020-2024 STACKOOM.COM