title: Making a custom keyboard on iPad, need help with some parts
body: <p>Right now I'm making a custom keyboard for an app. I've set up a keyboard that mimics the look of the regular keyboard, but with specific keys that I put in. I also set up a view controller that has the image along with a series of transparent UIButtons placed over each of the keys in IB. Here's the code so far:</p>
  
  <pre><code>//CustomKeyBoardViewController.h
  
  #import &lt;UIKit/UIKit.h&gt;
  
  @protocol CustomKeyBoardViewControllerDelegate
  - (void) buttonTapped:(NSString*)text;
  - (void) doneTapped;
  @end
  
  
  @interface CustomKeyBoardViewController : UIViewController {
      id&lt;CustomKeyBoardViewControllerDelegate&gt; _delegate;
  }
  
  -(IBAction)spaceTapped:(id)sender;
  -(IBAction)goTapped:(id)sender;
  
  -(IBAction)xTapped:(id)sender;
  
  -(IBAction)plusTapped:(id)sender;
  -(IBAction)minusTapped:(id)sender;
  -(IBAction)arrowTapped:(id)sender;
  -(IBAction)slashTapped:(id)sender;
  
  -(IBAction)oneTapped:(id)sender;
  -(IBAction)twoTapped:(id)sender;
  -(IBAction)threeTapped:(id)sender;
  -(IBAction)fourTapped:(id)sender;
  -(IBAction)fiveTapped:(id)sender;
  -(IBAction)sixTapped:(id)sender;
  -(IBAction)sevenTapped:(id)sender;
  -(IBAction)eightTapped:(id)sender;
  -(IBAction)nineTapped:(id)sender;
  -(IBAction)zeroTapped:(id)sender;
  
  @property(nonatomic, assign) id&lt;CustomKeyBoardViewControllerDelegate&gt; _delegate;
  
  @end
  
  
  //CustomKeyBoardViewController.m
  
  #import "CustomKeyBoardViewController.h"
  
  @implementation CustomKeyBoardViewController
  
  @synthesize _delegate, Keyboard;
  
  - (IBAction)spaceTapped:(id)sender {if (_delegate != nil) {[_delegate buttonTapped:@" "];}}
  
  - (IBAction)goTapped:(id)sender {if (_delegate != nil) {[_delegate buttonTapped:@"Go"];}}
  
  
  - (IBAction)xTapped:(id)sender {if (_delegate != nil) {[_delegate buttonTapped:@"x"];}}
  
  
  - (IBAction)plusTapped:(id)sender {if (_delegate != nil) {[_delegate buttonTapped:@"+"];}}
  
  - (IBAction)minusTapped:(id)sender {if (_delegate != nil) {[_delegate buttonTapped:@"-"];}}
  
  - (IBAction)arrowTapped:(id)sender {if (_delegate != nil) {[_delegate buttonTapped:@"^"];}}
  
  - (IBAction)slashTapped:(id)sender {if (_delegate != nil) {[_delegate buttonTapped:@"/"];}}
  
  
  - (IBAction)oneTapped:(id)sender {if (_delegate != nil) {[_delegate buttonTapped:@"1"];}}
  
  - (IBAction)twoTapped:(id)sender {if (_delegate != nil) {[_delegate buttonTapped:@"2"];}}
  
  - (IBAction)threeTapped:(id)sender {if (_delegate != nil) {[_delegate buttonTapped:@"3"];}}
  
  - (IBAction)fourTapped:(id)sender {if (_delegate != nil) {[_delegate buttonTapped:@"4"];}}
  
  - (IBAction)fiveTapped:(id)sender {if (_delegate != nil) {[_delegate buttonTapped:@"5"];}}
  
  - (IBAction)sixTapped:(id)sender {if (_delegate != nil) {[_delegate buttonTapped:@"6"];}}
  
  - (IBAction)sevenTapped:(id)sender {if (_delegate != nil) {[_delegate buttonTapped:@"7"];}}
  
  - (IBAction)eightTapped:(id)sender {if (_delegate != nil) {[_delegate buttonTapped:@"8"];}}
  
  - (IBAction)nineTapped:(id)sender {if (_delegate != nil) {[_delegate buttonTapped:@"9"];}}
  
  - (IBAction)zeroTapped:(id)sender {if (_delegate != nil) {[_delegate buttonTapped:@"0"];}}
  
  - (void)viewDidLoad {
      [super viewDidLoad];
  }
  
  - (BOOL)shouldAutorotateToInterfaceOrientation:(UIInterfaceOrientation)interfaceOrientation {
      return ((interfaceOrientation == UIInterfaceOrientationPortrait) || 
              (interfaceOrientation == UIInterfaceOrientationPortraitUpsideDown));
  }
  
  
  - (void)didReceiveMemoryWarning {[super didReceiveMemoryWarning];}
  
  
  - (void)viewDidUnload {[super viewDidUnload];}
  
  
  - (void)dealloc {[super dealloc];}
  
  
  @end
  </code></pre>
  
  <p>I've gotten this figured out with help from <a href="http://www.raywenderlich.com/1063/ipad-for-iphone-developers-101-custom-input-view-tutorial" rel="nofollow">this</a> and <a href="http://www.ifans.com/forums/showthread.php?t=201671" rel="nofollow">this</a>.</p>
  
  <p>The issue is using it in another view controller. I've read that you need to use a custom UIView and make it the inputView for that view controller's text fields. </p>
  
  <p>What I need help with is putting this in a view instead of a view controller in a way that works. 
  These are my main questions:</p>
  
  <p>Do I need to put all of this code in the view instead? </p>
  
  <p>Do I even need this view controller?</p>
  
  <p>If I don't need the view controller, what do I need to do to put the image of the keyboard in the view?</p>
  
  <p>Any help is appreciated</p>