@State var copiedText: String = \"\"
private let pastboard = UIPasteboard.general
var body: some View {
TextField(\"This is plceholdr\", text: $myText)
.border(.red).padding()
Button {
pastboard.string = copiedText
} label: {
Label(\"Copy to Clipboard\", systemImage: \"doc.on.doc\")
}
}
SHORT QUESTIONS
How i will copy text in swiftui?
@State var copiedText: String = \"\" private let pastboard = UIPasteboard.general var body: some View { TextField(\"This is plceholdr\", text: $myText) .border(.red).pad...
0 Comments
Leave a Comment