0

I created a custom keyboard to fill specific text in a table. To do this I connected the button from the storyboard to the viewController.swift

 @IBAction func ECOAction(_ sender: Any) {
    self.textDocumentProxy.insertText("ECO")
}

All the buttons works as desired. For easier work I want to have a button that selects all text where the buttons insert their text. Like using the short-cut + a. An other way is when a button is touched, the existing content is deleted before inserting the new.

I have no idea how to do it nor where to search. I appreciate any suggestion and keywords for searching a solution.

ROOT
  • 11,363
  • 5
  • 30
  • 45
Christian
  • 506
  • 4
  • 14
  • I found this one https://stackoverflow.com/questions/33930656/how-to-select-all-text-in-a-uitextfield-using-swift/39356923 – Gökhan Sayılgan Jul 22 '19 at 09:09
  • This will select all: https://stackoverflow.com/questions/1689911/programmatically-select-all-text-in-uitextfield – Vollan Jul 22 '19 at 09:11
  • Thanks - but I have no textField. I use the keyboard for a web-form. I found self.textDocumentProxy.deleteBackward() but there is nothing to do it forward... – Christian Jul 22 '19 at 11:09

0 Answers0