Posts

Showing posts from May 21, 2013

How to customize position of the keyboard in iOS

First of all you need to write this code in -viewDidLoad method  [[ NSNotificationCenter defaultCenter ] addObserver : self selector : @selector (keyboardWillAppear) name : UIKeyboardDidShowNotification object : nil ]; After that create a method keyboardWillApear -( void )keyboardWillAppear {     UIWindow * tempWindow = [[[ UIApplication sharedApplication ] windows ] objectAtIndex : 1 ];          //Because we cant get access to the UIPeripheral throught the SDK we will just use UIView.     //UIPeripheral is a subclass of UIView anyways     UIView* keyboard;          //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]; ...