diff --git a/iosApp/flare/Common/OPMLFile.swift b/iosApp/flare/Common/OPMLFile.swift index 317ac49f5..bb5c02412 100644 --- a/iosApp/flare/Common/OPMLFile.swift +++ b/iosApp/flare/Common/OPMLFile.swift @@ -1,26 +1,27 @@ import SwiftUI import UniformTypeIdentifiers +extension UTType { + nonisolated static var opml: UTType { + UTType(exportedAs: "dev.dimension.flare.opml", conformingTo: .xml) + } +} + struct OPMLFile: FileDocument { - // tell the system we support only plain text - static let readableContentTypes = [UTType(exportedAs: "opml", conformingTo: .plainText)] + nonisolated static var readableContentTypes: [UTType] { [.opml] } - // by default our document is empty var text = "" - // a simple initializer that creates new, empty documents init(initialText: String = "") { text = initialText } - // this initializer loads data that has been saved previously init(configuration: ReadConfiguration) throws { if let data = configuration.file.regularFileContents { text = String(decoding: data, as: UTF8.self) } } - // this will be called when the system wants to write our data to disk func fileWrapper(configuration: WriteConfiguration) throws -> FileWrapper { let data = Data(text.utf8) return FileWrapper(regularFileWithContents: data) diff --git a/iosApp/flare/Info.plist b/iosApp/flare/Info.plist index 59d68bb64..75f7d22a5 100644 --- a/iosApp/flare/Info.plist +++ b/iosApp/flare/Info.plist @@ -17,24 +17,47 @@ - UTExportedTypeDeclarations - - - UTTypeConformsTo - - public.text - - UTTypeIdentifier - opml - UTTypeTagSpecification - - public.filename-extension - - opml - - - - + CFBundleDocumentTypes + + + CFBundleTypeName + OPML Document + CFBundleTypeRole + Viewer + LSHandlerRank + Default + LSItemContentTypes + + dev.dimension.flare.opml + + + + UTExportedTypeDeclarations + + + UTTypeConformsTo + + public.xml + public.text + + UTTypeDescription + OPML Document + UTTypeIdentifier + dev.dimension.flare.opml + UTTypeTagSpecification + + public.filename-extension + + opml + + public.mime-type + + text/x-opml + application/xml + + + + diff --git a/iosApp/flare/UI/Screen/RssScreen.swift b/iosApp/flare/UI/Screen/RssScreen.swift index e64e1c758..a570c9075 100644 --- a/iosApp/flare/UI/Screen/RssScreen.swift +++ b/iosApp/flare/UI/Screen/RssScreen.swift @@ -147,7 +147,7 @@ struct EditRssSheet: View { .fileImporter( isPresented: $showFileImporter, allowedContentTypes: [ - UTType(exportedAs: "opml", conformingTo: .plainText), + .opml, .plainText, .xml, .text,