From 38217e43e41aa485c462819ee4ff5c0cc9a2d98a Mon Sep 17 00:00:00 2001 From: Stuart Breckenridge Date: Fri, 21 Jan 2022 08:51:50 +0800 Subject: [PATCH] initial 6.2 commit - Switches to `UTType` for ShareViewController --- NetNewsWire.xcodeproj/project.pbxproj | 8 ++++++++ iOS/ShareExtension/ShareViewController.swift | 9 +++++---- 2 files changed, 13 insertions(+), 4 deletions(-) diff --git a/NetNewsWire.xcodeproj/project.pbxproj b/NetNewsWire.xcodeproj/project.pbxproj index ff66384e0..c533942ad 100644 --- a/NetNewsWire.xcodeproj/project.pbxproj +++ b/NetNewsWire.xcodeproj/project.pbxproj @@ -4628,6 +4628,7 @@ isa = XCBuildConfiguration; baseConfigurationReference = 1768140A2564BB8300D98635 /* NetNewsWire_iOSwidgetextension_target.xcconfig */; buildSettings = { + IPHONEOS_DEPLOYMENT_TARGET = 15.0; }; name = Debug; }; @@ -4635,6 +4636,7 @@ isa = XCBuildConfiguration; baseConfigurationReference = 1768140A2564BB8300D98635 /* NetNewsWire_iOSwidgetextension_target.xcconfig */; buildSettings = { + IPHONEOS_DEPLOYMENT_TARGET = 15.0; }; name = Release; }; @@ -4656,6 +4658,7 @@ isa = XCBuildConfiguration; baseConfigurationReference = 51314617235A797400387FDC /* NetNewsWire_iOSintentextension_target.xcconfig */; buildSettings = { + IPHONEOS_DEPLOYMENT_TARGET = 15.0; }; name = Debug; }; @@ -4663,6 +4666,7 @@ isa = XCBuildConfiguration; baseConfigurationReference = 51314617235A797400387FDC /* NetNewsWire_iOSintentextension_target.xcconfig */; buildSettings = { + IPHONEOS_DEPLOYMENT_TARGET = 15.0; }; name = Release; }; @@ -4670,6 +4674,7 @@ isa = XCBuildConfiguration; baseConfigurationReference = 515D4FCE2325B3D000EE1167 /* NetNewsWire_iOSshareextension_target.xcconfig */; buildSettings = { + IPHONEOS_DEPLOYMENT_TARGET = 15.0; }; name = Debug; }; @@ -4677,6 +4682,7 @@ isa = XCBuildConfiguration; baseConfigurationReference = 515D4FCE2325B3D000EE1167 /* NetNewsWire_iOSshareextension_target.xcconfig */; buildSettings = { + IPHONEOS_DEPLOYMENT_TARGET = 15.0; }; name = Release; }; @@ -4754,6 +4760,7 @@ isa = XCBuildConfiguration; baseConfigurationReference = 51121AA12265430A00BC0EC1 /* NetNewsWire_iOSapp_target.xcconfig */; buildSettings = { + IPHONEOS_DEPLOYMENT_TARGET = 15.0; }; name = Debug; }; @@ -4761,6 +4768,7 @@ isa = XCBuildConfiguration; baseConfigurationReference = 51121AA12265430A00BC0EC1 /* NetNewsWire_iOSapp_target.xcconfig */; buildSettings = { + IPHONEOS_DEPLOYMENT_TARGET = 15.0; }; name = Release; }; diff --git a/iOS/ShareExtension/ShareViewController.swift b/iOS/ShareExtension/ShareViewController.swift index 9da5495db..3a3f7178f 100644 --- a/iOS/ShareExtension/ShareViewController.swift +++ b/iOS/ShareExtension/ShareViewController.swift @@ -12,6 +12,7 @@ import Account import Social import RSCore import RSTree +import UniformTypeIdentifiers class ShareViewController: SLComposeServiceViewController, ShareFolderPickerControllerDelegate { @@ -46,14 +47,14 @@ class ShareViewController: SLComposeServiceViewController, ShareFolderPickerCont // Try to get any HTML that is maybe passed in for item in self.extensionContext!.inputItems as! [NSExtensionItem] { for itemProvider in item.attachments! { - if itemProvider.hasItemConformingToTypeIdentifier(kUTTypePropertyList as String) { + if itemProvider.hasItemConformingToTypeIdentifier(UTType.propertyList.identifier) { provider = itemProvider } } } if provider != nil { - provider!.loadItem(forTypeIdentifier: kUTTypePropertyList as String, options: nil, completionHandler: { [weak self] (pList, error) in + provider!.loadItem(forTypeIdentifier: UTType.propertyList.identifier, options: nil, completionHandler: { [weak self] (pList, error) in if error != nil { return } @@ -73,14 +74,14 @@ class ShareViewController: SLComposeServiceViewController, ShareFolderPickerCont // Try to get the URL if it is passed in for item in self.extensionContext!.inputItems as! [NSExtensionItem] { for itemProvider in item.attachments! { - if itemProvider.hasItemConformingToTypeIdentifier(kUTTypeURL as String) { + if itemProvider.hasItemConformingToTypeIdentifier(UTType.url.identifier as String) { provider = itemProvider } } } if provider != nil { - provider!.loadItem(forTypeIdentifier: kUTTypeURL as String, options: nil, completionHandler: { [weak self] (urlCoded, error) in + provider!.loadItem(forTypeIdentifier: UTType.url.identifier, options: nil, completionHandler: { [weak self] (urlCoded, error) in if error != nil { return }