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
Problem with the safe area when using a UITableView with static cells #330
Comments
I'm so sorry I overlooked this issue. Thank you so much for your detail report and workaround. I will check this issue in detail and consider to merge the workaround to the library. |
I tried to repro this issue using Xcode_11.3.1 + iOS 13.4.1 in your app, but it doesn't seem to reproduce in 13.4.1 now. (Unfortunately, I don't have an iOS 13.3.1 device, so I couldn't confirm it there). However, your workaround is considered perfectly fine to apply to the lib, so I would change it to apply it. Thank you very much for your report. I'm glad for you to use the lib on your excellent app. |
It could very well have been fixed in iOS 13.4, but I can't confirm that as I recently switched to using dynamic cells. Thank you for the great library and glad you like the app! |
Description
There is a very weird issue where the
safeAreaInsets
of the content controller isn't updated and stays.zero
when the content is aUITableViewController
with static cells, and only when using the release configuration.Expected behavior
This is how it looks in debug mode:
Actual behavior
And this is how it looks in release mode:
I found the source of the problem after some debugging, and it's here:
https://github.com/SCENEE/FloatingPanel/blob/bed519f0c0152440aa75cf40813415e17fc0d5f7/Framework/Sources/FloatingPanelController.swift#L425-L427
What happens is that
change.oldValue
andchange.newValue
are alwaysnil
in release mode when the content is a table view with static cells. The value ofview.safeAreaInsets
is actually updated, butchange.newValue
staysnil
!I tried using dynamic cells instead of static cells and the problem is solved. So, it seems to be a bug in iOS itself.
As a workaround, I had to change the condition to the following:
guard change.oldValue != self?.view.safeAreaInsets else { return }
Steps to reproduce
You can run the project here in release mode: https://github.com/MhdHejazi/CoronaTracker/tree/62075763e830a10681b5038fe0aca1dbbb2e2d47
How do you display panel(s)?
Add as child view controllers
How many panels do you displays?
Environment
Library version
1.7.4
Installation method
iOS version(s)
13.3.1
Xcode version
11.3.1
The text was updated successfully, but these errors were encountered: