Skyscanner / SkyFloatingLabelTextField

A beautiful and flexible text field control implementation of "Float Label Pattern". Written in Swift.
Apache License 2.0
4.09k stars 542 forks source link

Memory Leak issue #179

Closed robertodias180 closed 6 years ago

robertodias180 commented 6 years ago

Report

What did you do?

There is some issue on iOS 11.1, not sure about 11.0 because I did not test it, as for iOS 10 it works like perfectly.

The issue is that once you interact with the view it won ever be dealloc. I added a deinit method to SkyFloatingLabelTextField.swift in order to test it, on ios 10 it gets called every time but on 11.1 it does not.

if need I can provide a sample project.

Xcode Version: 9.1 (9B55) SkyFloatingLabelTextField Version: 3.3.0 Deployment Target: 9.0 Method of Integration: CocoaPods

k0nserv commented 6 years ago

Hmm that's super strange. Thanks for investigating. A sample project would be great

k0nserv commented 6 years ago

Just tested this on master with the example project. I'm seeing deinit being called on iOS 11.1 for all cases

robertodias180 commented 6 years ago

@k0nserv here is an example

k0nserv commented 6 years ago

That's super strange. I'm not seeing it with that example either. Both the second view controller and the two fields are getting deinited for me. I'm on Xcode 9.1(9B55) with the iOS 11.1 iPhone 8 Plus simulator. @bogren can you be a third person here?

robertodias180 commented 6 years ago

@k0nserv if I open and close the view it calls deinited but if you select any of the fields or write any text on them and then click back it does not.

k0nserv commented 6 years ago

You are right. It seems like UIkeyboardImpl is keeping a reference to the instances after the view is removed.

image

k0nserv commented 6 years ago

I can replicate this with a regular UITextField. I think this is a iOS bug rather than a SkyFloatingLabelTextField specific issue.

image

robertodias180 commented 6 years ago

that makes things worst since we can't fix it...

thanks for the help @k0nserv 😃