Closed cmoulton closed 7 years ago
I have same problem when pressing "i" button on the map which is on modal view controller.
Warning: Attempt to present <UIAlertController: 0x7fc8e20378f0> on <OurViewController: 0x7fc8e20107e0> whose view is not in the window hierarchy!
This regression was introduced by #8371. Thank you for the suggested fix, @cmoulton!
/cc @friedbunny
Thanks for the excellent demo project and fix @cmoulton!
This fixed the issue with the UIAlertController not opening from the attribution button, but the nested telemetry UIAlertController won't open for what appears to be the same issue. I can open a separate issue, but it seems to possibly be the same issue as this one just in a different area.
Thanks @kmorey. Can you please create a new issue for the telemetry controller specifically?
Platform:
iOS
Mapbox SDK version:
3.5.2 via cocoapods
Steps to trigger behavior
Expected behavior
Attribution UIAlertController displayed
Actual behavior
No change in UI (other than button highlight state). Error shown in console:
Demo Project
https://github.com/cmoulton/MapboxModalAttributionTest
Need to set mapbox access token in info.plist to use.
(Map views in green)
I think the change required is to change this code in MGLMapView.mm (line 1947):
To fetch the current top view controller (based on http://stackoverflow.com/a/21848247/90743):