Pull Request Detail screen

I had little bit problems with UIView for leaving comments. I've decide to place this view right into pull request detail screen. The main problem - I don't know right way to show/hide keyboard and place UIView relative to keyboard.
I've feel that my current solution isn't perfect and good at all. So, it should be fixed, but I don't how exactly.

I've googled so mush but couldn't found right way to do this :)
Unfortunately, solution from official docs isn't what I'm looking for.
https://developer.apple.com/library/ios/documentation/StringsTextFonts/Conceptual/TextAndWebiPhoneOS/KeyboardManagement/KeyboardManagement.html