0

Haven't found it on internet, searching on google I found Custom Keyboard as extension with is not what I need.

I need to make so that when you pressed my "Keyboard" on the bottom right (Its not actually a Keyboard, it is just a couple of UIButtons) the Inputs appear on the text field (Its the white space below ACTUAL CASH DEPOSIT). enter image description here

So, when you press the text field, no keyboard should Appear, and When I start pressing the buttons of my "Custom Keyboard" the numbers should Appear.

I have found something similar in (Xcode 8 Swift 3). Using Custom Keyboard Extension with a particular Text Field But On my other Tap, Denominations I have multiple Input Fields. Like his image: enter image description here

I know how to do all the code behind in terms of buttons pressed and calculations But I don't know how to make the input fields as a responder for my custom Keyboard.

Mago Nicolas Palacios
  • 2,501
  • 1
  • 15
  • 27

1 Answers1

0

You can't make it magically update - instead, I'd suggest binding all the buttons to a single function, and then then for instance use the tag property in IB to differentiate between them. Through that function update the text.

func didPressButton(button: UIButton) {
  switch button.tag{
  case 1: myTextField.text! += "1"
  default: break
  }
}

I'd caution you'll need to do some verification logic if you allow decimals so all numbers are valid.

sschale
  • 5,168
  • 3
  • 29
  • 36