App hangs on navigation bar rendering cycle

We are currently having an issue with our app hanging for some (not all) of our iOS 26.x users. The hang lasts long enough for the system to kill the app after a while.

As of now we are unable to reproduce the issue on our own test devices, yet users dealing with the issue can produce it consistently.

Looking at the stack traces we managed to retrieve, the hangup seems to occur in the layout rendering cycle of the navigation bar in the UINavigationController. The hangup doesn't happen at the exact same stack trace every time. But it always seems to be in the rendering cycle.

Since the issue not reproducable in our own test environment it's hard to properly debug.

The only adjustments to the navigationbar/navigationitem in our code is setting the title and a few bar buttons:

self.navigationItem.title = NSLocalizedString("main_list_title", comment: "")
        
let cancelItem = UIBarButtonItem(barButtonSystemItem: .stop, target: self, action: #selector(cancelListSelection))
        let addPostItem = UIBarButtonItem(image: UIImage(named: "AddButton"), style: .plain, target: self, action: #selector(addItemTapped))
let extraMenuItem = UIBarButtonItem(image: UIImage(named: "ExtraButton"), style: .plain, target: self, action: #selector(extraItemTapped))
        
self.navigationItem.setLeftBarButton(cancelItem, animated: true)
       self.navigationItem.setRightBarButtonItems([addPostItem, extraMenuItem], animated: true)
        
let previousButton = UIBarButtonItem(image: UIImage(named: "LeftArrow"), style: .plain, target: self, action: #selector(openPrevious))
let nextButton = UIBarButtonItem(image: UIImage(named: "RightButton"), style: .plain, target: self, action: #selector(openNext))
        
self.setToolbarItems([previousButton, nextButton], animated: true)

And for one or two controllers the title is replaced by a UISegmentControl:

let segControl = UISegmentedControl(items: ["1", "2", "3"]);
segControl.selectedSegmentIndex = 0
segControl.addTarget(self, action: #selector(segmentValueChanged), for: .valueChanged)
self.navigationItem.titleView = segControl

Is anyone familiar with hangs at these particular stack traces and their cause?

Thanks for the interesting post and the stack trace files. I was wondering that if is a hang you can actually provide the hang files from the sysdiagnose so we can see where is it hanging?

On the stack traces you provided, there is a layout loop occurring entirely within UIKit? If so the system will eventually killing the app and you’ll get a hang tile because the main thread is stuck in this cycle and becomes unresponsive.

In the stack trace 2 there is a xamarin_UIApplicationMain` Are you using the 3rd party tool?

You should check with the support resources provided by the 3rd party to get assistance with their software.

Unless another developer in the forums has experience with the third-party and can provide assistance.

Albert  WWDR

I've managed to find the cause of the issue and it's unrelated to the third party tools used.

It seems whenever a custom font is applied to UILabel's general appearance like this for example:

UILabel.appearance().font = UIFont(name: "Galafera", size: 14.0)

(Using Galafera for the example, but it happens on any custom fonts added to the app)

then the app hangs whenever the UINavigationBar has to truncate its title (due to many UIBarButtonItems for example).

I have a project showing the same issue in a regular Swift project without any third party tools. Adding the bar buttons will cause the app to hang on several devices (tested with iPhone SE and iPhone 17 with Display Zoom enabled on iOS 26.5)

(Is there any way to add the example project to the post?)

And is there a workaround available to make sure adding a custom font to the UILabel's in the app doesn't break the navigation bar?

Thank you for your post. Very interesting that hangs on a custom font. If you encounter the same issue while using Xcode only and can provide a focus sample project, I recommend uploading it along with a bug report.

Once you open the bug report, please post the FB number here for my reference.

If you have any questions about filing a bug report, take a look at Bug Reporting: How and Why?

Albert  WWDR

@TTAppDev Thank you for providing the FB number, it seems like reached the correct team and they'll communicate with you over the Feedback Assistant app.

Thanks

Albert  WWDR

App hangs on navigation bar rendering cycle
 
 
Q