I do understand how to go about making the UIKeyboard
push up the UIView
if the active UITextView
is blocked by the UIKeyboard
as per this question: How to make a UITextField move up when keyboard is present?.
What I'm wondering is, from a design perspective, how do you go about implementing the keyboardDidShow
and keyboardDidHide
methods so that all of the views in your app, whether they be a UIView
, UITableView
, or UIScrollView
all have this functionality and so you need to implement these methods only once?
The only way I could think of would be to have the view property of the UIViewController
always set to a UIView
, and if you have a UIViewController
that needs a UIScrollView
or UITableView
, just attach it as a subview to this. Then if the UITextView
is being blocked, just move the parent UIView
up so it will move all of the views that are attached to it.
Does this sound like a good plan, or is it even worth it? Anyone else have any other ideas?