textview reloadLayoutIfNeeded positioning is not accurate
When the height of the textview in the uicollectionViewcell is too high, when reloadLayoutIfNeeded, it will return to the top of the cell. Causes the textview to be obscured by the keyboard.
Versions
Xcode: 13.4.1 Mac OS: 12.3.1 Simulator/Device: Simulator SE3 Simulator/Device Name: iPhone SE3 Library Version: 6.5.10
Can you please share a demo project with me?
https://user-images.githubusercontent.com/19399512/182302958-e6d90860-9ec2-41be-8430-2bbe5d029605.mov
@hackiftekhar
I technically got why the problem is happening. It's happening because the origin of the textView is itself out of the screen, so there are some miscalculations or may be something not good happening due to this. But for a solution/fix it would take some time since I need to dig into the complex code.
Look forward to a fix for this issue
I tried to reproduce this with the latest version of the library and I no longer able to reproduce the issue, so it looks like it get's fixed somehow with some of the recent changes.
https://github.com/hackiftekhar/IQKeyboardManager/assets/19399512/d672ad07-95be-458b-a258-150342929d6e
IQKeyboardManagerSwift Version (6.5.6) I still have the same problem trying to run this demo
@hackiftekhar
I got the point @cs571393 however this is expected behavior in your case. Because when you scroll, you scroll the scrollview not the textView.
So when you call reloadLayoutIfNeeded(), it reposition the scrollView which is expected if you call this function.
From development perspective you shouldn't be putting a scrollView (UITextView in your case) inside another scrollView which may produce undefined behavior like yours.
From the technical perspective it's working as I would expect and unfortunately you should consider changing the UI elements a little bit to not include scrollview inside another scrollview to fix it.