0

I am trying to open a xcloc file, the file is a folder and the type in macOS called package. However, I could not open it as the init(configuration: ReadConfiguration) throws never called.

struct XliffFile: FileDocument {
    var xliff:XMLXliff
    
    static var readableContentTypes: [UTType] = [
            UTType(filenameExtension: "xliff", conformingTo: .data)!,
            UTType(filenameExtension: "xcloc", conformingTo: .package)!
        ]
    
    init(xliff: XMLXliff = XMLXliff()) {
        self.xliff = xliff
    }

    init(configuration: ReadConfiguration) throws {
        print(configuration.file.filename)
    }
}

If the file is xliff, the app runs. But for xcloc file, nothing runs. If I don't use DocumentGroup but using fileImport, everything worked file.

jnpdx
  • 45,847
  • 6
  • 64
  • 94
Owen Zhao
  • 3,205
  • 1
  • 26
  • 43

0 Answers0