Select to view content in your preferred language

iOS 16 & AGSPopupsViewController

643
4
09-14-2022 06:44 PM
RTC
by
Emerging Contributor

Just noticed with iOS 16 the AGSPopupsViewController is not working correctly. I have a UINavigationController displaying in a popover view with a table view of map features. Clicking on a feature will push theAGSPopupsViewController for the selected feature. This worked fine until iOS 16. Now after the AGSPopupsViewController is pushed, the popover view jumps randomly to a different point. Anyone else experiencing this?

 

Basic code snippet that is not working:

let popupsViewController = AGSPopupsViewController(popups: item.popups, containerStyle: .navigationController)
popupsViewController.modalPresentationStyle = .formSheet
popupsViewController.preferredContentSize = CGSize(width: 500, height: 600)
popupsViewController.modalPresenter = self.tappedFeatureNavController?.topViewController
popupsViewController.delegate = self

// Present the popup.
// NOTE: Bug with iOS 16 breaks popover causing it to lose its anchor point and get cut off.
self.tappedFeatureNavController?.pushViewController(popupsViewController, animated: true)
0 Kudos
4 Replies
MarkDostal
Esri Regular Contributor

Sorry to hear you are having problems.  I have tested the basic scenario with the "AGSPopupsViewController" and did not see any issues with iOS 16 (or iOS 15.5) in the simulator.  If you could provide a bit more information about what context you're displaying the popups from I can help you resolve your issue.

You said you're using iOS 16.  Are you running on a device or simulator (or doesn't it matter)?  If you could provide some screen shots of what you're seeing that would be great.  Also, some more information on what the view controller hierarchy is, either through some sample code/pseudo code/screen shots, that would help.

-Mark

0 Kudos
RTC
by
Emerging Contributor

Thanks for the reply Mark!

A little more clarification:

  1. We are seeing the issue on devices (phone and tablet) and simulator.
  2. Control hierarchy
    1. We have a AGSMapView displaying a webmap with features
    2. Additional operational layers are added to the webmap to display additional graphics
    3. Tapping on the map view runs an identify on all the layers,
    4. A UINavigationController is used to display a popover, anchored to the tap point
    5. A UITableviewController with identified items from map tap is displayed in the popover. These could be webmap features as well as graphics from the added operational layers.
    6. Tapping on one of the identified items, in the table view, triggers the code from previous post.
    7. Once the AGSPopupsViewController is pushed, the popover jumps and anchors to the edge of the AGSMapView.

FYI: It appears to be an issue with the transition/animation of the nav controller push. Setting animate to false does not create the issue.

Thanks!

0 Kudos
MarkDostal
Esri Regular Contributor

I created a similar scenario, based on your information.  It seems to be working for me, but let me know if this mimic's your situation.  The items in the list view are `AGSPopup`s.  They don't have a title, so I'm simply using the "popup.geoElement.geometry.description" as the text in the table view cell.  Tapping on a row creates a new "AGSPopupsViewController" with a single Popup and then pushes it onto the navigation stack:  "navigationController?.pushViewController(popupsViewController, animated: true)"

I'm using Xcode 14 and the iPad Pro (9.7-inch) iOS 16 simulator.

Screen Recording - iPad Pro (9.7-inch) - Popup Test.gif

 

Let me know how well this matches your code; if you are able provide some code that reproduces the issue in a simple project, that would help.

Mark

0 Kudos
RTC
by
Emerging Contributor

Thanks Mark!  I did some more testing and it looks like the issue has to do with dynamic sizing of the popovers. When the popover first appears, it is sized to fit the number of results in the table view. Then when an item is selected, the AGSPopupsViewController is pushed but at a size to fit its content. If I remove the resizing elements, it works just like your example. I will see if there is something in the sizing that is causing the issue.

Thanks for you help!

0 Kudos