Thanks Polyphonic!
So, my current understanding is that Document Types, Name could be anything, but I suppose it may be seen by users somewhere. And Types should be public.plain-text. As for Imported Type Identifiers, I'm going with what's shown (generically) in the image below. After changing the Imported Type Identifiers, Identifier as shown, I needed to use the same value in the code created by the Doc App template. See the code below.
I created two test apps using the Doc App template, GreenPurple1 and GreenPurple2, and they both created .txt files and they could (obviously?) open and edit files created by the other app.
And per Polyphonic's recommendation to validate that my app has just opened (only) UTF8 data, I've searched for how this is done and it appears this won't be 10 lines of Swift code or fewer. But if you know otherwise, please share!
import SwiftUI
import UniformTypeIdentifiers
extension UTType {
static var exampleText: UTType {
UTType(importedAs: "com.CompanyName.GreenPurple1")
}
}
Topic:
UI Frameworks
SubTopic:
SwiftUI
Tags: