We read every piece of feedback, and take your input very seriously.
To see all available qualifiers, see our documentation.
1 parent 9136cc1 commit 4d015f8Copy full SHA for 4d015f8
Sushitrain/DeviceView.swift
@@ -172,21 +172,8 @@ struct DeviceView: View {
172
if !lastAddress.isEmpty {
173
Section("Current addresses") {
174
Label(lastAddress, systemImage: "network").contextMenu {
175
- Button(action: {
176
- #if os(iOS)
177
- UIPasteboard.general.string = lastAddress
178
- #endif
179
-
180
- #if os(macOS)
181
- let pasteboard = NSPasteboard.general
182
- pasteboard.clearContents()
183
- pasteboard.prepareForNewContents()
184
- pasteboard.setString(
185
- lastAddress, forType: .string)
186
187
- }) {
188
- Text("Copy to clipboard")
189
- Image(systemName: "doc.on.doc")
+ Button("Copy to clipboard", systemImage: "doc.on.doc") {
+ writeTextToPasteboard(lastAddress)
190
}
191
192
0 commit comments