initial 6.2 commit

- Switches to `UTType` for ShareViewController
This commit is contained in:
Stuart Breckenridge
2022-01-21 08:51:50 +08:00
parent 9381e8ef77
commit 38217e43e4
2 changed files with 13 additions and 4 deletions

View File

@@ -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;
};

View File

@@ -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
}