When I rotate the device in the simulator, I receive the following message in the console: [App] if we're in the real pre-commit handler we can't actually add any new fences due to CA restriction
.
There is plenty of information about how to suppress the warning, such as in this question. However, it seems like that is just side stepping the problem without actually solving anything.
What exactly does the warning mean and how do I fix it?
"What exactly does the warning mean?"
Unfortunately, I don't know enough about the internals of CoreAnimation to fully explain the message's meaning. The second answer attempts to explain it by examining disassembled code.
"How do I fix it?"
This likely cannot be fixed by you because it is not a problem with your app, despite what the message might suggest with its use of "[App]". (The second answer to the referenced question says as much also.)
I believe this message began appearing in iOS 10, and it happens (typically) during device rotation. My evidence that it can't be fixed is that if you create a blank "Single View App" project, launch it (simulator or device) and rotate the screen the message will be emitted.
As of iOS 12 beta 4, this message is no longer being emitted when rotating the screen. That's not to say it won't happen at other times, as the reason UIKit is emitting it probably has some merit in other circumstances. If possible, try your app out in Xcode 10 beta 4 to see if it still prints the message.
It's worth mentioning here as well, that it's a bad idea to suppress the message with OS_ACTIVITY_MODE
as that method suppresses far too much valuable debugging information, such as stack traces.
If you love us? You can donate to us via Paypal or buy me a coffee so we can maintain and grow! Thank you!
Donate Us With