The keyboardWillShow
function of FormVC does not get called. The keyboard actually adds the input to the row, but the auto scrolling does not happen
Is this only a problem in Eureka or perhaps a problem using the Navigation controller's pushViewController
?
The correct way to use the FormVC is with the Container, as per the comment in the question.
Here is a great explanation credit to Miguel Revetria - source, github:
Hi chefren the problem with your approach is that the
FormViewController
lifecycle is not being handled because you are not adding it to the view controllers hierarchy. Actually you are only adding its view to one of your views.The function
keyboardWillShow
is not being called due to theFormViewController
adds this observer to the notificationNotification.Name.UIKeyboardWillShow
from the functionviewWillAppear
, which in your case is not being called. As this, other stuff may not work properly, because the view controller lifecycle is not being handled.That is not the way the
FormViewController
should be used. Using it in that way may end up with an undesired behavior like you experienced. The correct way to embed aFormViewController
in other view controller's view is by adding it as a Child View Controller. See this Apple guide for further information Implementing a Container View Controller. Additionally, in storyboards you can use aContainer View
.Regards