0

UITextView's inputView and inputAccessoryView are very cool!

Right now I'm using the inputView to replace the keyboard when the user requests it. The docs say that after changing the inputView or the inputAccessoryView we have to call -reloadInputViews which, acording to the docs, does not animate the change:

You can use this method to refresh the custom input view or input accessory view associated with the current object when it is the first responder. The views are replaced immediately—that is, without animating them into place. If the current object is not the first responder, this method has no effect.

This means whenever the user presses the button to toggle the inputView, the keyboard disappears and the inputView appears and all happens instantly, which looks very un-iOS7-y due to the lack of a nice animation.

So, my question is: is it possible to animate the inputView into place when toggling it (without resorting to App Store-prohibitive actions)?.

Alex
  • 5,009
  • 3
  • 39
  • 73

1 Answers1

0

You could do this by having your custom controls be in a sub view - then have the main view animate the sub view in.

I suspect the api limitation is there so that Apple don't have to try making a one-size-fits-all animation.

David Doyle
  • 1,716
  • 10
  • 23
  • Let's imagine I wanted to do a simple dissolve animation from the keyboard to my view. Your suggestion would only animate my view; the keyboard would still disappear instantly and think that would look odd... However, this outcome is not unexpected: I doubted there would be a way to force the animation of the keyboard itself without resorting to private API and view hierarchy manipulation. Oh well... – Alex May 11 '14 at 11:51
  • In that case - you could try recreating a keyboard through a different control. See: https://github.com/kulpreetchilana/Custom-iOS-Keyboards – David Doyle May 12 '14 at 11:21
  • I think I'd rather stick with the default keyboard for now. But I appreciate your suggestion; it's always nice to know, and I might need to use it in other projects. – Alex May 12 '14 at 12:56