So for my application I needed to add a button to the number pad keyboard because I wanted users to be able to enter decimal values but the standard button keyboard doesnt include the decimal. And using a full keyboard has a lot of wasted keys that I had to restrict the user from hitting.
Then I came across this post that discussed the issue somewhat.
I wanted to elaborate on that post to show how I was able to actually access the view of the keyboard to add my own buttons.
Step 1: Follow the instructions in the above post to handle the messages sent when the the keyboard is going to be show/hidden. This will help you understand a little more about how the keyboard works.
For my use I didnt really need to know the information regarding position of the keyboard and all that, but it was handy to know when it is being show.
Step 2: Check out the code below that actually gets you a reference to the UIKeyboard view (UIView) which will allow you to add subviews.
//The UIWindow that contains the keyboard view - It some situations it will be better to actually
//iterate through each window to figure out where the keyboard is, but In my applications case
//I know that the second window has the keyboard so I just reference it directly
UIWindow* tempWindow = [[[UIApplication sharedApplication] windows] objectAtIndex:1];
//Because we cant get access to the UIKeyboard throught the SDK we will just use UIView.
//UIKeyboard is a subclass of UIView anyways
//Iterate though each view inside of the selected Window
for(int i = 0; i < [tempWindow.subviews count]; i++)
//Get a reference of the current view
keyboard = [tempWindow.subviews objectAtIndex:i];
//Check to see if the className of the view we have referenced is "UIKeyboard" if so then we found
//the keyboard view that we were looking for
if([[keyboard className] isEqualToString:@UIKeyboard] == YES)
//Keyboard is now a UIView reference to the UIKeyboard we want. From here we can add a subview
//to th keyboard like a new button
//Do what ever you want to do to your keyboard here...
I put the above code inside of the appDelegate into a method that I call the first time that the user shows the textbox (figured that out using the didShow method in step1).
Im not much of a tutorial writter, but hopefully that will shine some light on how to add custom items to your keyboards