DispatchQueue.main.async

This commit is contained in:
Jed Fox 2022-12-15 07:39:05 -05:00
parent 4f8ca8d481
commit cd6bdead01
No known key found for this signature in database
GPG Key ID: 0B61D18EA54B47E1
1 changed files with 33 additions and 35 deletions

View File

@ -195,12 +195,12 @@ extension StatusTableViewCellDelegate where Self: DataSourceProvider & AuthConte
) { _ in
UIPasteboard.general.url = url
},
UIAction(
title: L10n.Common.Controls.Actions.share,
image: Asset.Arrow.squareAndArrowUp.image.withRenderingMode(.alwaysTemplate)
) { _ in
Task {
await MainActor.run {
DispatchQueue.main.async {
let activityViewController = UIActivityViewController(
activityItems: [
URLActivityItemWithMetadata(url: url) { metadata in
@ -222,14 +222,13 @@ extension StatusTableViewCellDelegate where Self: DataSourceProvider & AuthConte
transition: .activityViewControllerPresent(animated: true)
)
}
}
},
UIAction(
title: L10n.Common.Controls.Status.Actions.shareLinkInPost,
image: Asset.ObjectsAndTools.squareAndPencil.image.withRenderingMode(.alwaysTemplate)
) { _ in
Task {
await MainActor.run {
DispatchQueue.main.async {
self.coordinator.present(
scene: .compose(viewModel: ComposeViewModel(
context: self.context,
@ -242,7 +241,6 @@ extension StatusTableViewCellDelegate where Self: DataSourceProvider & AuthConte
)
}
}
}
])
}