What does "invalid mode 'kCFRunLoopCommonModes' ..."mean?

Solution 1:

I think it's a warning that Apple should fix it itself. Even in this sample project which is from WWDC19 this problem exists. There is a UISwitch in a cell of a table. When I tap it, the mentioned warning is raised.

So, in my view, it is a bug that Apple should deal with.

Solution 2:

Judging from the replies by Apple Developer Relations to this post, this is a bug in UIKit and one that Apple is tracking. Until the bug is fixed, the advice is to treat this as "log noise".

Solution 3:

I had a similar problem: When I got the call-back from the UISwitch, I reloaded the UITableView. I think that the call-back is initiated before the UISwitch finishes changing its context, and reloading the cell in that state creates some conflict.

With that theory, I solved my problem like so: I separated the cells into sections, where the cell with the UISwitch was in its own section. When I got the call-back from the UISwitch, I reloaded all the sections except the section that has the cell with the UISwitch.