Fix several iOS 17 deprecation warnings.

This commit is contained in:
Brent Simmons
2024-11-03 22:40:38 -08:00
parent 8644380d07
commit 4f0cacdd3f
11 changed files with 35 additions and 28 deletions

View File

@@ -11,6 +11,7 @@ import Account
import CoreServices
import SafariServices
import SwiftUI
import UniformTypeIdentifiers
class SettingsViewController: UITableViewController {
@@ -418,19 +419,10 @@ private extension SettingsViewController {
func importOPMLDocumentPicker() {
let utiArray = UTTypeCreateAllIdentifiersForTag(kUTTagClassFilenameExtension, "opml" as NSString, nil)?.takeRetainedValue() as? [String] ?? [String]()
var opmlUTIs = utiArray
.compactMap({ UTTypeCopyDeclaration($0 as NSString)?.takeUnretainedValue() as? [String: Any] })
.reduce([String]()) { (result, dict) in
return result + dict.values.compactMap({ $0 as? String })
}
opmlUTIs.append("public.xml")
let docPicker = UIDocumentPickerViewController(documentTypes: opmlUTIs, in: .import)
docPicker.delegate = self
docPicker.modalPresentationStyle = .formSheet
self.present(docPicker, animated: true)
let documentPicker = UIDocumentPickerViewController(forOpeningContentTypes: [UTType.opml, UTType.xml], asCopy: true)
documentPicker.delegate = self
documentPicker.modalPresentationStyle = .formSheet
self.present(documentPicker, animated: true)
}
func exportOPML(sourceView: UIView, sourceRect: CGRect) {