mirror of
https://github.com/omnivore-app/omnivore.git
synced 2026-03-11 08:54:26 +00:00
use NSPasteboard for macos copying
This commit is contained in:
parent
0a9b9f1387
commit
629c378244
1 changed files with 10 additions and 1 deletions
|
|
@ -84,7 +84,16 @@ struct NewsletterEmailsView: View {
|
|||
ForEach(viewModel.emails) { newsletterEmail in
|
||||
Button(
|
||||
action: {
|
||||
UIPasteboard.general.string = newsletterEmail.email
|
||||
#if os(iOS)
|
||||
UIPasteboard.general.string = newsletterEmail.email
|
||||
#endif
|
||||
|
||||
#if os(macOS)
|
||||
let pasteBoard = NSPasteboard.general
|
||||
pasteBoard.clearContents()
|
||||
pasteBoard.writeObjects([newsletterEmail.email as NSString])
|
||||
#endif
|
||||
|
||||
NSNotification.operationSuccess(message: "Email copied")
|
||||
},
|
||||
label: { Text(newsletterEmail.email) }
|
||||
|
|
|
|||
Loading…
Reference in a new issue