Note that there are some explanatory texts on larger screens.

plurals
  1. PO
    text
    copied!<p>Here some new informations I've found:</p> <p>I saw that the Keyboard was closing only the first time. Example: The view was loaded with the UITextView as the firstResponder. Scrolling, the keyboard would close. But, after tapping on the UITextView again, the keyboard would open again and then never close, even if scrolling again.</p> <p>Looking for understanding the reason, I discovered this:</p> <ul> <li>In the "viewDidLoad" I was setting the first responder</li> <li>in the cellForRowAtIndexPath I was adding the UITextView as a subview</li> <li>the cellForRowAtIndexPath is called after the ViewDidLoad</li> </ul> <p>When the UITextView was resigning first responder, I saw that it was happening because the UITableView was searching for that particular cell calling the CellForRowAtIndexPath method. But, After tapping again, the CellForRowAtIndexPath was called only for other cells, not the selected one. It seemed that, if the UITextView was setted as the first responder AFTER the UITableView setup, the cell was retained even if not visible.</p> <p>Then, I tried to move the "becomefirstresponder" in the "viewDidAppear" (called AFTER the uitableview setup) and then, magically, the problem was solved :-) The cell is no more released if the UITextView inside is the first responder.</p> <p>The only remaining problem was this: calling "becomeFirstResponder" in the viewDidApper cause a lag in the keyboard to show on the screen. To avoid this, I called becomeFirstResponder in viewDidLoad, then in viewDidAppear I resigned and called again becomeFirstResponder.</p> <p>Hope this helps</p>
 

Querying!

 
Guidance

SQuiL has stopped working due to an internal error.

If you are curious you may find further information in the browser console, which is accessible through the devtools (F12).

Reload