diff --git a/iOS/Settings/SettingsViewController.swift b/iOS/Settings/SettingsViewController.swift index 737530e66..39a87e808 100644 --- a/iOS/Settings/SettingsViewController.swift +++ b/iOS/Settings/SettingsViewController.swift @@ -415,11 +415,27 @@ private extension SettingsViewController { } func importOPMLDocumentPicker() { + var contentTypes: [UTType] = [] - let docPicker = UIDocumentPickerViewController(forOpeningContentTypes: [UTType.opml, UTType.xml], asCopy: true) - docPicker.delegate = self - docPicker.modalPresentationStyle = .formSheet - self.present(docPicker, animated: true) + // Create UTType for .opml files by extension, without requiring conformance. + // This ensures files ending in .opml can be selected no matter how OPML is registered. + // + if let opmlByExtension = UTType(filenameExtension: "opml") { + contentTypes.append(opmlByExtension) + } + + // Also try the registered org.opml.opml UTI if it exists + if let registeredOPML = UTType("org.opml.opml") { + contentTypes.append(registeredOPML) + } + + // Include XML as a fallback + contentTypes.append(.xml) + + let documentPicker = UIDocumentPickerViewController(forOpeningContentTypes: contentTypes, asCopy: true) + documentPicker.delegate = self + documentPicker.modalPresentationStyle = .formSheet + self.present(documentPicker, animated: true) } func exportOPML(sourceView: UIView, sourceRect: CGRect) {