UIToolbar size in iOS26

In my UIKit app, in my view controller, I have a toolbar at the bottom of the screen and a UITextView, and I need to get the size of the toolbar to calculate the correct keyboard intersection, and change my text view layout so that the text doesn't get obscured when the keyboard is shown on screen. It's been working fine till now, but with iOS26, I am running into an issue, because the toolbar size is completely different.

For this code:

    NSInteger offset = (self.navigationController.isToolbarHidden == NO)? (self.navigationController.toolbar.frame.size.height): 0;

iOS18 returns '49' iOS26 returns ''812'.

This obviously throws off the calculations for keyboard avoidance.

Is there a way to overcome this, other than ignoring or hard-coding toolbar height?

If you are trying to dodge the keyboard, the recommendation has been to use the UIKeyboardLayoutGuide. If you are just trying to dodge any content that may be intersection your content, the recommendation is to use safeAreaInsets or the safeAreaLayoutGuide. Reading the toolbar frame hasn't been recommended for a long time, as there is no guarantee that the toolbar is the only thing down there you may need to dodge.

UIToolbar size in iOS26
 
 
Q