iosswiftcocoapodsiqkeyboardmanagerxcode14

xcode 14 warning: Cannot access property 'Some_name' here in deinitializer; this is an error in Swift 6


When importing the IQKeyboardManager library in my project, after upgrading to XCode 14, I get these warnings in some of the imported classes:

enter image description here After making a copy of 'self', only non-isolated properties of 'self' can be accessed from a deinit.

I am getting this warning in deinit of most of the classes, I am getting this warning in some of the other third party library classes as well. I understand its meaning, but what should be the workaround for this? Any source where we can get an idea for fixing this?


Solution

  • In your screenshot I can see you are using the IQKeyboardManager library in your project. The warnings are not about your code, but about the IQKeyboardManager code you have imported.

    More context: swift language is changing what is and is not allowed. This specific issue is being discussed on the Swift forum. Depending on the outcome of this discussion, the IQKeyboardManager team may or may not have to change the code.

    For now, I don't see a problem if you just ignore the warnings. In the future, the issue will probably be solved for you, either by the Swift team or by the IQKeyboardManager team.

    I have also filed an issue on the IQKeyboardManager github.