I have simple subclass of UIViewController (code below). If I attach inputAccessoryView, my viewcontroller is never deallocated. If I do not set inputAccessoryView in viewDidLo
Unfortunately for me @rdelmar's answer didn't work. After some time spent trying to solve it I found this article: http://derpturkey.com/uitextfield-docked-like-ios-messenger/
My goal is to have the input accessory view visible even if the keyboard is not, exactly like in all IM apps. I previously subclassed my UIViewController
custom class to allow it to become first responder and returned my custom subview as inputAccessoryView
. This was preventing the view controller from being dealloced. Now I subclass the controller's view to achieve the same thing as recommended in the link above, everything seems to work fine.
EDIT: after some more testing I can confirm the custom UIView is dealloced just fine.
EDIT 2: only downside is that you can't make the keyboard appear in viewWillAppear
, the inputAccessoryView
is not already added to the view hierarchy and can't become first responder.