I have a Catalyst app that I'm adding a sidebar to via UISplitViewController
. I have a toolbar on the window with buttons that I want to be enabled or disabled based on the state of the view controller in the split view's secondary
column. But it seems to want to check the primary
view controller instead.
In the Catalyst tutorial Adding a Toolbar, this exact approach is demonstrated. The RecipeDetailViewController
has methods for toggleFavorite
and editRecipe
, and the toolbar items are set up to reference those selectors in the ToolbarDelegate
class. In the screenshots in the tutorial, the buttons are shown as enabled based on RecipeDetailViewController.canPerformAction
. But when I download and run the complete project on my computer (macOS 14.4.1), the toolbar items are disabled. And if I add the methods to the RecipeListViewController
(which is in the primary
column of the UISplitViewController
, the toolbar items get enabled.
Is there a way to make the system ask the correct split view column for canPerformAction
? Or is this a bug?