0

I have some text that user will be able to paste later on into UITextField. How can I copy that text programmatically?

Anton Tropashko
  • 5,486
  • 5
  • 41
  • 66

1 Answers1

1

By from jtbandes's Answer

  • To Copy
@IBAction fucn btnCopyClick(_ sender: UIButton)
{   
    UIPasteboard.general.string = YourTextField.text!
}
  • Paste
let contentText = UIPasteboard.general.string
steveSarsawa
  • 1,559
  • 2
  • 14
  • 31