Full Keyboard Access causing SwiftUI TabView bug?

I’m having an issue with an app I’ve developed where it grinds to a halt and freezes when using the TabView with a certain iOS Setting enabled.

To simplify things, I can easily reproduce this with a demo project.

Launch Xcode 12.5, start a new iOS project with swift, swiftUI lifecycle and SwiftUI interface. Then replace the Text code in the content view body with ithe following simple code:

TabView {
    Text("Hello, world! Tab 1")
       .tabItem {
           Label("Tab 1", systemImage: "list.dash")
        }
    Text("Tab 2")
       .tabItem {
           Label("Tab 2", systemImage: "list.dash")
        }
  }

If you launch and run this on device or on the simulator, it all works fine. You can click between the tabs etc…

However, if you navigate to the iPhone settings (and this is available in the simulator) and go Accessibility -> Keyboards -> Full Keyboard Access and toggle this ON, it causes a problem.

When re-opening the app we just made, as soon as you select a tab at the bottom, the app CPU usage jumps to 100%+ and grinds to a halt. The only fix is to force quite the app, but the issue persists on re-launches until you disable Full Keyboard Access. 

Is this a bug? Or am I missing something? It seems to have been around throughout iOS 14’s life time.

Thank you

Answered by simonfromhelix in 723375022

This was fixed in iOS 15, issue persists for iOS 14 even if built with Xcode 13.

Hi, thanks for pointing this out! Can you file a Feedback for this with the specific reproduction steps, and post the number here?

Yes of course, it's FB8970333. I filed it 6 months ago when I first thought it was a bug but heard nothing back so still wondering if its intended behaviour? The feedback include a dead simple sample project with similar to above code. Thanks

Hey, we are having the same issue. Is there already a fix for this? @simonfromhelix

Accepted Answer

This was fixed in iOS 15, issue persists for iOS 14 even if built with Xcode 13.

Full Keyboard Access causing SwiftUI TabView bug?
 
 
Q