Compare commits
No commits in common. "a12afb8dc2054e627678df450713a57c64efe8f2" and "c17cf460d78dc325562e32d371956f8c308d3e27" have entirely different histories.
a12afb8dc2
...
c17cf460d7
|
@ -7,14 +7,7 @@
|
|||
<key>NSExtensionAttributes</key>
|
||||
<dict>
|
||||
<key>NSExtensionActivationRule</key>
|
||||
<dict>
|
||||
<key>NSExtensionActivationSupportsImageWithMaxCount</key>
|
||||
<integer>4</integer>
|
||||
<key>NSExtensionActivationSupportsMovieWithMaxCount</key>
|
||||
<integer>1</integer>
|
||||
<key>NSExtensionActivationSupportsWebURLWithMaxCount</key>
|
||||
<integer>1</integer>
|
||||
</dict>
|
||||
<string>TRUEPREDICATE</string>
|
||||
</dict>
|
||||
<key>NSExtensionMainStoryboard</key>
|
||||
<string>MainInterface</string>
|
||||
|
|
|
@ -84,23 +84,12 @@ class ShareViewController: UIViewController {
|
|||
}
|
||||
} else if let text: NSString = await getObject(from: itemProvider) {
|
||||
return ("\n\n\(text)", [])
|
||||
} else if let attachment: DraftAttachment = await getObject(from: itemProvider) {
|
||||
return ("", [attachment])
|
||||
} else if let attributedContent = inputItem.attributedContentText {
|
||||
return ("\n\n\(attributedContent.string)", [])
|
||||
} else {
|
||||
let attachments = await withTaskGroup(of: DraftAttachment?.self, returning: [DraftAttachment].self) { group in
|
||||
for provider in inputItem.attachments! {
|
||||
group.addTask { @MainActor in
|
||||
await self.getObject(from: provider)
|
||||
}
|
||||
}
|
||||
|
||||
return await group.reduce(into: [], { partialResult, result in
|
||||
if let result {
|
||||
partialResult.append(result)
|
||||
}
|
||||
})
|
||||
}
|
||||
return ("", attachments)
|
||||
return ("", [])
|
||||
}
|
||||
}
|
||||
|
||||
|
|
Loading…
Reference in New Issue