Article Theme / UniformTypeIdentifiers

This commit is contained in:
Stuart Breckenridge
2022-01-21 13:07:38 +08:00
parent 6c9c3749bb
commit ca690859f7
2 changed files with 9 additions and 1 deletions

View File

@@ -7,6 +7,13 @@
//
import Foundation
import UniformTypeIdentifiers
public extension UTType {
static var nnwTheme: UTType {
UTType("com.ranchero.netnewswire.theme")!
}
}
struct ArticleTheme: Equatable {

View File

@@ -7,6 +7,7 @@
//
import Foundation
import UniformTypeIdentifiers
import UIKit
@@ -27,7 +28,7 @@ class ArticleThemesTableViewController: UITableViewController {
}
@objc func importTheme(_ sender: Any?) {
let docPicker = UIDocumentPickerViewController(documentTypes: ["com.ranchero.netnewswire.theme"], in: .import)
let docPicker = UIDocumentPickerViewController(forOpeningContentTypes: [.nnwTheme], asCopy: true)
docPicker.delegate = self
docPicker.modalPresentationStyle = .formSheet
self.present(docPicker, animated: true)