10.5 C
Canberra
Wednesday, June 17, 2026

ios – UITabBarController on iPadOS 18 swallows all touches even with mode = .tabBar (by way of Python/rubicon-objc)


I am constructing a Python iOS app with Toga 0.5.x (Briefcase 0.3.16), which backs toga.OptionContainer with a UITabBarController. The app works completely on iPhone, however on iPad Professional (M5, iOS 18 simulator) the complete residence display is non-responsive after login — touches should not delivered to Python handlers.

What works:

  • Login (tapping the login button fires accurately)

  • The toga detailed checklist renders and is seen

  • The tab bar is seen on the high

What would not:

  • Tapping any row within the detailed checklist — tableView:didSelectRowAtIndexPath: by way of UITableViewDelegate by no means fires

  • Tapping the UIBarButtonItem

  • Tapping the tab bar objects themselves

Prognosis thus far:

I set UITabBarController.mode = .tabBar (worth 1) instantly after creation, earlier than the controller is added to any window, utilizing the express ObjC selector by way of rubicon-objc:

self.home_option._impl.native_controller.setMode_(1)
print(self.home_option._impl.native_controller.mode)  # prints: 1

The log confirms mode is about to 1. The UITabBarController is simply added to the window’s view hierarchy after the window is seen and the person has logged in. However regardless of all this, no touches attain Python on iPad. The exact same code on iPhone delivers all touches accurately.

My idea: iPadOS 18 is inserting some invisible overlay or touch-intercepting view over the content material when UITabBarController is used on iPad, even in .tabBar mode. This prevents hit-testing from reaching the desk view or bar button objects.

Minimal copy:

import toga
from toga.fashion import Pack
from toga.fashion.pack import COLUMN

class MyApp(toga.App):
    def startup(self):
        content_box = toga.Field(fashion=Pack(course=COLUMN, flex=1))
        label = toga.Label('Faucet me')
        btn = toga.Button('Press', on_press=lambda w: print('pressed!'))
        content_box.add(label, btn)

        tab = toga.OptionContainer(
            content material=[('Tab 1', content_box)],
            fashion=Pack(flex=1),
        )
        # Set mode = .tabBar on iPad iOS 18
        tab._impl.native_controller.setMode_(1)

        main_box = toga.Field(fashion=Pack(course=COLUMN, flex=1))
        main_box.add(tab)

        self.main_window = toga.MainWindow()
        self.main_window.content material = main_box
        self.main_window.present()

On iPad iOS 18 simulator, urgent the button by no means prints 'pressed!'. On iPhone it really works.

Questions:

  1. What’s iPadOS 18 doing to UITabBarController that blocks contact supply, even in .tabBar mode?

  2. Is there a UITabBarController delegate methodology, subclass override, or configuration that restores regular hit-testing on iPad iOS 18?

  3. Is there a strategy to examine which view is intercepting touches (e.g. by way of Xcode’s View Debugger, I can test if there’s an invisible overlay)?

Surroundings: Xcode 16, iOS 18.x simulator, TARGETED_DEVICE_FAMILY = "1,2" (Common), Python 3.12, rubicon-objc 0.4.9, toga-iOS 0.5.1.

Related Articles

LEAVE A REPLY

Please enter your comment!
Please enter your name here

[td_block_social_counter facebook="tagdiv" twitter="tagdivofficial" youtube="tagdiv" style="style8 td-social-boxed td-social-font-icons" tdc_css="eyJhbGwiOnsibWFyZ2luLWJvdHRvbSI6IjM4IiwiZGlzcGxheSI6IiJ9LCJwb3J0cmFpdCI6eyJtYXJnaW4tYm90dG9tIjoiMzAiLCJkaXNwbGF5IjoiIn0sInBvcnRyYWl0X21heF93aWR0aCI6MTAxOCwicG9ydHJhaXRfbWluX3dpZHRoIjo3Njh9" custom_title="Stay Connected" block_template_id="td_block_template_8" f_header_font_family="712" f_header_font_transform="uppercase" f_header_font_weight="500" f_header_font_size="17" border_color="#dd3333"]
- Advertisement -spot_img

Latest Articles