UIDocumentBrowserViewController iOS16 additionalTrailingNavigationBarButtonItems are duplicated

Hi,

I have an app on AppStore using UIDocumentBrowserViewController, see link below. I have "Settings" icon as a trailing Navigation Bar item menu. WIth iOS16, that icon is duplicated... No issue with iOS14 or 15.

If I change from TrailingNavigation to LeadingNavigation, I don't see the issue.

I have created a sample app and I can repro the same issue. Also, I checked another vendor app who I think is also using UIDocumentBrowserVIewController and I can see the same issue.

Do I just raise a defect report?

Thank you

Maurice

https://apps.apple.com/au/app/private-photo-video-document/id1625834751

Replies

The only time my app had duplicate toolbar buttons was when the toolbar extension was attached inside an element in a List. When I moved the toolbar up in the view hierarchy, that fixed it. But this is just guessing without seeing any code of yours, and my app is SwiftUI.

  • Snip from sample app: let Settings_symbol = UIImage(systemName: "gear.circle") let Settings_image = resizeImage(image: Settings_symbol!, targetHeight: targetHeight, targetWidth: targetWidth) let Settings_image_with_render = Settings_image.withRenderingMode(.alwaysOriginal) let Settings_barbutton = UIBarButtonItem(image: Settings_image_with_render, style: .done, target: self, action: #selector(Settings_menu)) documentBrowserView.additionalTrailingNavigationBarButtonItems = [Settings_barbutton]

  • Can't see anything wrong with that. Maybe the issue is elsewhere or that is a defect you could report. Having a minimal reproductive sample would be good to have.

Add a Comment