I have a custom NSTabViewController displayed from within an NSPopOver and as you can see from the image below, the NSTabViewItems contain custom NSButtons. My issue is that in order to support the latest Accessibility requirements, I would like to have the a specific tab have keyboard focus. Setting InitialFirstResponder does not work. Nor does calling MakeFirstResponder within ViewDidAppear, the normal way. The hack that works for me is within the NSTabViewController's ViewDidAppear override, I do a 250ms delay, on a background thread, and then call MakeFirstResponder on the NSButton I want focus on.
This works as desired, but I'm not fond of hacks, so I'm looking for a more elegant and presumably more correct solution. I'm new to MacOS dev, so looking for the best practice solution, if there is one.