Search code examples
iphonexcodeuikeyboardtype

iphone calculator keyboard


I am pretty new to iPhone development, so I don't know if this is even possible, but is it possible to customize a keyboard so it looks like a calculator? I know how to use inputAccessoryView to put buttons on top of the keyboard, but I would like to put the add, multiply, divide and subtract buttons on the side to make it look like a more standard calculator. Is this possible?

Thanks.


Solution

  • You will need a whole replacement "keyboard" with your own buttons and actions to do this. This will be a UIView holding a set of UIButtons. If you want this to pop up like the regular keyboard (as opposed to being on screen all the time like in the calculator app) then set your new view to be the inputView of your text field rather than the inputAccessoryView.