In iOS 5 if you are creating a custom control such as aUITextField or UITextView, there is a keyboard type specifically designed for writing tweets – the keyboard includes the characters @ and # on the primary view (no tapping necessary for a secondary keyboard view).

The following code example shows how to set the twitter keyboard in a UITextView:

UITextView *twitterView;
...
twitterView = [[UITextView alloc] initWithFrame:CGRectMake(10, 40, 300, 100)];
[twitterView setBackgroundColor:[UIColor whiteColor]];
[twitterView setFont:[UIFont fontWithName:@"Arial" size:18]];
[twitterView setKeyboardType:UIKeyboardTypeTwitter];
 
[[self view] addSubview:twitterView];