Q:

How To Implement Custom keyboard with UISearchBar?

In My application i develope a custom keyboard in one of local language.Now this keyboard works fine with UITextField and UITextView.For both these i implement the Custom keyboard like this.
textField.inputView = Customkeyboard;
textView.inputView = Customkeyboard;

But when i implement its for UISearchBar 
searchBar.inputView = Customkeyboard;

its gives me Following Error.

error: object cannot be set - either readonly property or no setter found

i also set its property and Synthesis,but unable to solve this problem.Can any one help me to solve this problem.Thanx.

A:

According to class documentation of UIResponder

The value of this property is nil. Responder objects that require a custom view to gather input from the user should redeclare this property as readwrite and use it to manage their custom input view. When the receiver subsequently becomes the first responder, the responder infrastructure presents the specified input view automatically. Similarly, when the view resigns its first responder status, the responder infrastructure automatically dismisses the specified view. 

Okay, create a class inherited from UISearchBar like below .h and .m files. In your .h file ad the folowing lines

@interface SearchBar : UISearchBar
  @property (readwrite, retain) UIView *inputView;
  @end

In your current controller where you are using this, replace UISearchBar with SearchBar.

searchBar.inputView = Customkeyboard; // Where searchBar is an object of SearchBar and not UISearchBar

