-
Notifications
You must be signed in to change notification settings - Fork 2.4k
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
IQKeyboardReturnKeyHandler retain cycle #1228
Comments
I'll check the memory and retain cycle issues. Thanks for letting me know about this. |
I tried to fix memory issues with v5.0.8, let's see if that works for you. |
unfortunately it's still with the same result. deinit is not executed when creating instance from (controller: self). |
You should release the IQReturnKeyHandler object wirh deinit of your ViewController. if it doesn't work then I'll try to take a look again. |
But how can you release it in the deinit if deinit is never executed due to retain cycle? That's exactly the problem :) What did work tho is this:
|
okay, let me see then. |
I got the point, it's because the IQKeyboardReturnKeyHandler is keeping reference of textField delegate and most of the time it's the ViewController who owns it. A fix is on the way. |
In swift code i have IQKeyboardReturnKeyHandler as per documentation. Just adding the field and creating an instance from (controller: self) makes a retain cycle somehow. Easiest way to check is to add deinit method with a log line. Without IQKeyboardReturnKeyHandler the log line appears, with IQKeyboardReturnKeyHandler it does not - the controller stays in memory.
The text was updated successfully, but these errors were encountered: