Open mmatiush opened 2 months ago
I did a few changes, can you please check this again with the current master branch version?
I tested the demo project and it's still looks to be working correctly with current version. However I did a few fixes so please check it again. I think it should not produce any leaks now.
@hackiftekhar I've installed the master brach commit 82aa948.
It partially fixed the issue.
Now the ChatViewController is successfully deinited when you: 1) Tap on the back button (it worked this way the iOS 15.3.1, but now it also works on 17.3.1) 2) Hide the keyboard and swipe back to pop
The problem remains: 1) Keyboard is not hidden and you swipe back to pop
@hackiftekhar do you think could you check it again and reopen the issue? I can get more details if needed
Sure @mmatiush. I'm here to help.
I'm unable to reproduce the mentioned issue. This is what I did
Result: In my case the keyboard get's successfully dismissed.
@hackiftekhar
Sorry for the confusion in the source code.
Please uncomment this line to enable the library and the issue will be reproduced
Yeah, you are right, it doesn't work the way it should.
@hackiftekhar do you think it can be fixed?
I need to look at it again to find the solution. I'm always here to fix issue caused due to IQKeyboardManager.
Describe the bug The view controller containing a UITextField is not deinitialized after you pop the view controller on condition that you interacted with the UITextField (touched it).
To Reproduce Steps to reproduce the behavior:
IQKeyboardManager.shared.enable = true
on viewDidLoadExpected behavior VC2 is deinitialized after it's popped.
Demo Project TextFieldLeak.zip
I have a ViewController (initial VC1) and a ChatViewController (VC2) that contains a UITextField. I've added the debug prints on ChatViewController to see when it's loaded and deinitialized.
Screenshots
There some system warnings, but the deinit is no called.![CleanShot 2024-07-04 at 15 12 26](https://github.com/hackiftekhar/IQKeyboardManager/assets/33353007/4f7890e3-7b1b-48f6-8756-ab8f56f09f7e)
Memory graph after popping the ChatViewController![CleanShot 2024-07-04 at 15 21 38](https://github.com/hackiftekhar/IQKeyboardManager/assets/33353007/f7f569ec-c52d-4547-8681-5e679468eb2c)
Versions
Xcode: 15.4 Mac OS: Sonoma 14.3.1 Device: 17.3.1 Device Name: iPhone 14 Pro Library Version: 7.0.3
Additional context
If IQKeyboardManager is not enabled, the ChatViewController is not retained.
// IQKeyboardManager.shared.enable = true
On iPhone 12 mini with iOS 15.3.1 the bug is reproduced only if you swipe back to pop the view controller with the text field. If you tap the back button, the view controller is successfully deinitialized.
If you tap any other text field in the app, the ChatViewController will be deinited.