I had been doing something like this to mimic the keyboard animation on older version of iOS.
CGRect keyboardBeginFrame;
[[note.userInfo objectForKey:UIKeybo
If you mean to add the button inside a toolbar (similarly as the mobile Safari does it), you can just use the property inputAccessoryView
(both UITextField
and UITextView
have it) and save yourself all the trouble. This hidden gem is little known, I am glad that I stumbled upon it.
It works on both iOS 6 and iOS 7, I am using it in my app Routie.