Post

Replies

Boosts

Views

Activity

Reply to Is there a tech note for menuBuilder?
There’s a sample app you can refer to. Look at the documentation for UIMenuBuilder. The overview has a link to the “Adding menus and shortcuts to the menu bar and user interface” sample app. In short, the menu walks the responder chain to find the responder that handles the selector. This means the active window and its view hierarchy will be looked at to handle the menu. If your window’s rootViewController is where you handle the menu‘s selector then that controller should know its own document to handle. In my own app my main root view controller class handles most menu items. This makes it easy for a given window to handle and validate the menu. The app delegate is only used to handle and validate menu items that are not window specific.
Topic: UI Frameworks SubTopic: UIKit
Aug ’25
Reply to Is there a tech note for menuBuilder?
My menu code is all in Objective-C too (old app still going). I've been using UIMenuBuilder since iOS 14 in support of macOS via Mac Catalyst. My proposed solution also works now on the iPad in iOS 26. Your case is slightly more complicated than mine. I support multiple scenes but all of the scenes are the same class with the same root view controller class. First, design your overall app menu taking into account the needs of general app-level menu items and items specific to each of your scenes' root view controllers. In the end you will have common menu items used by all scenes, you will have items specific to each scene, and you will have items that work even if there are no open scenes. Once you know all of the possible menu items, you will use UIMenuBuilder in the app delegate to build the entire possible menu structure. Then there will be validation code in the app delegate and each of your possible root view controllers. Each root view controller will only validate the items it can handle. For those it can't it calls super. And the app delegate handles what it can and for those it can't it disables them. With that general approach, if Scene A is in focus, then it validates its own specific menu item and punts to the app delegate for the rest. The app delegate will handle a few and disable the rest. This means that while Scene A is in focus, any menu items specific to Scene B will be disabled (in the app delegate by default). Here's some example skeleton code: In AppDelegate.m: - (void)buildMenuWithBuilder:(id<UIMenuBuilder>)builder { [super buildMenuWithBuilder:builder]; if (builder.system != UIMenuSystem.mainSystem) { return; } // Remove unwanted standard File menu: [builder removeMenuForIdentifier:UIMenuOpenRecent]; [builder removeMenuForIdentifier:UIMenuOpen]; [builder removeMenuForIdentifier:UIMenuDocument]; // Add some new File menu items UICommand *item1 = [UIKeyCommand commandWithTitle:@"Item 1" image:[UIImage systemImageNamed:@"some.symbol"] action:@selector(item1MenuAction:) input:@"I" modifierFlags:UIKeyModifierShift | UIKeyModifierCommand propertyList:nil]; UICommand *item2 = [UIKeyCommand commandWithTitle:@"Item 2" image:[UIImage systemImageNamed:@"other.symbol"] action:@selector(item2MenuAction:) input:@"J" modifierFlags:UIKeyModifierShift | UIKeyModifierCommand propertyList:nil]; UIMenu *extraItems = [UIMenu menuWithTitle:@"" image: nil identifier:nil options:UIMenuOptionsDisplayInline children:@[ item1, item2 ]]; // NO_I18N [builder insertSiblingMenu:extraItems afterMenuForIdentifier:UIMenuClose]; // Build everything else as needed } - (void)validateCommand:(UICommand *)command { // Handle App level items here if ( command.action == @selector(someMenuAction:) || command.action == @selector(otherMenuAction:) || NO) { command.attributes &= ~UIMenuElementAttributesDisabled; // Always on } else if ( command.action == @selector(anotherMenuAction:) || NO) { if (someCondition) { command.attributes &= ~UIMenuElementAttributesDisabled; } else { command.attributes |= UIMenuElementAttributesDisabled; } } else { [super validateCommand:command]; } } Now add a validateCommand: to each of your root view controller classes. It should validate each of its own commands as needed. Call super for all other commands. Tedious but straight forward.
Topic: UI Frameworks SubTopic: UIKit
Aug ’25
Reply to UISearchController scope buttons disappear forever after dismissing search when embedded in a search tab
I filed two related UISearchBar scope button bug reports against beta 1. Still not fixed as of beta 5. Though earlier today I found a work around that might work in your case too. Set the search controller scopeBarActivation to .manual. Set the controller’s delegate. In the didPresentSearchController delegate method, call setShowScope(true, animated: true) on the search bar. In the willDismissSearchController delegate method, call setShowScope(false, animated: true) on the search bar. The latter one is key. The result looks slightly clunky but at least the scope buttons appear more than once.
Topic: UI Frameworks SubTopic: UIKit Tags:
Aug ’25
Reply to iOS 26 Beta 6 in Simulator
Presumably Xcode 26 beta 6 will be released next Tuesday and that should support iOS 26 beta 6. It’s unusual that Apple released iOS 26 beta 6 only a week after beta 5 and likely a week before Xcode 26 beta 6 comes out. In short, no there is no iOS 26 beta 6 simulator yet.
Aug ’25
Reply to Is there a tech note for menuBuilder?
I looked into migrating some of my existing validateCommand: code into canPerformAction:sender: and I hit a roadblock. In one of my cases I use the same selector for a whole set of menus. I use the command’s propertyList value to act accordingly. This is fine in validateCommand: since I have access to the command. But in canPerformAction:sender I only get the selector. The sender is a private type called _UIMenuBarItem. I can see in the debugger that there is a reference to the command and the propertyList but there’s no public API to get to either. BTW - that is the result while testing the Mac Catalyst version of the app.
Topic: UI Frameworks SubTopic: UIKit
Aug ’25
Reply to Toolbar tint color with Liquid Glass
There are several existing discussions on this bug. Many people have filed bug reports since beta 1. So far it seems as if Apple really wants black and white interfaces starting with iOS 26. The tintColor of UIBarButtonItem can work in some cases. Basically only for prominent buttons not made with a custom view. Feel free to file a bug report. Maybe one more will be enough for Apple to fix the problem.
Topic: UI Frameworks SubTopic: General
Aug ’25
Reply to iOS26 UISearchbar and UISearchController cancellation issues
The documentation for showsCancelButton clearly states that this property is ignored on an iPad so that is expected behavior. So this means that tapping the little x icon causing the search to be cancelled is, unfortunately, also expected. A Mac Catalyst version of a UIKit app has always had this undesired behavior. It seems Apple is making the iPad version work the same. It’s a poor choice in my opinion. File a request via Feedback Assistant asking for it to be changed. There are many bugs in iOS 26 related to UISearchBar. I’ve filed at least 3 separate bug reports and Apple doesn’t seem to care since none have been fixed. 2 of my reports were filed against beta 1. And my reports are about clearly broken functionality, not just things I would prefer to behave differently. But you should file your own bug reports for any incorrect or undesired behavior. Apple needs to know that things don’t work and that they are affecting people’s apps. Here’s a post I made summarizing the issues I’m still facing: https://developer.apple.com/forums/thread/797701
Topic: UI Frameworks SubTopic: UIKit Tags:
Aug ’25
Reply to Is there a tech note for menuBuilder?
There’s a sample app you can refer to. Look at the documentation for UIMenuBuilder. The overview has a link to the “Adding menus and shortcuts to the menu bar and user interface” sample app. In short, the menu walks the responder chain to find the responder that handles the selector. This means the active window and its view hierarchy will be looked at to handle the menu. If your window’s rootViewController is where you handle the menu‘s selector then that controller should know its own document to handle. In my own app my main root view controller class handles most menu items. This makes it easy for a given window to handle and validate the menu. The app delegate is only used to handle and validate menu items that are not window specific.
Topic: UI Frameworks SubTopic: UIKit
Replies
Boosts
Views
Activity
Aug ’25
Reply to Is there a tech note for menuBuilder?
My menu code is all in Objective-C too (old app still going). I've been using UIMenuBuilder since iOS 14 in support of macOS via Mac Catalyst. My proposed solution also works now on the iPad in iOS 26. Your case is slightly more complicated than mine. I support multiple scenes but all of the scenes are the same class with the same root view controller class. First, design your overall app menu taking into account the needs of general app-level menu items and items specific to each of your scenes' root view controllers. In the end you will have common menu items used by all scenes, you will have items specific to each scene, and you will have items that work even if there are no open scenes. Once you know all of the possible menu items, you will use UIMenuBuilder in the app delegate to build the entire possible menu structure. Then there will be validation code in the app delegate and each of your possible root view controllers. Each root view controller will only validate the items it can handle. For those it can't it calls super. And the app delegate handles what it can and for those it can't it disables them. With that general approach, if Scene A is in focus, then it validates its own specific menu item and punts to the app delegate for the rest. The app delegate will handle a few and disable the rest. This means that while Scene A is in focus, any menu items specific to Scene B will be disabled (in the app delegate by default). Here's some example skeleton code: In AppDelegate.m: - (void)buildMenuWithBuilder:(id<UIMenuBuilder>)builder { [super buildMenuWithBuilder:builder]; if (builder.system != UIMenuSystem.mainSystem) { return; } // Remove unwanted standard File menu: [builder removeMenuForIdentifier:UIMenuOpenRecent]; [builder removeMenuForIdentifier:UIMenuOpen]; [builder removeMenuForIdentifier:UIMenuDocument]; // Add some new File menu items UICommand *item1 = [UIKeyCommand commandWithTitle:@"Item 1" image:[UIImage systemImageNamed:@"some.symbol"] action:@selector(item1MenuAction:) input:@"I" modifierFlags:UIKeyModifierShift | UIKeyModifierCommand propertyList:nil]; UICommand *item2 = [UIKeyCommand commandWithTitle:@"Item 2" image:[UIImage systemImageNamed:@"other.symbol"] action:@selector(item2MenuAction:) input:@"J" modifierFlags:UIKeyModifierShift | UIKeyModifierCommand propertyList:nil]; UIMenu *extraItems = [UIMenu menuWithTitle:@"" image: nil identifier:nil options:UIMenuOptionsDisplayInline children:@[ item1, item2 ]]; // NO_I18N [builder insertSiblingMenu:extraItems afterMenuForIdentifier:UIMenuClose]; // Build everything else as needed } - (void)validateCommand:(UICommand *)command { // Handle App level items here if ( command.action == @selector(someMenuAction:) || command.action == @selector(otherMenuAction:) || NO) { command.attributes &= ~UIMenuElementAttributesDisabled; // Always on } else if ( command.action == @selector(anotherMenuAction:) || NO) { if (someCondition) { command.attributes &= ~UIMenuElementAttributesDisabled; } else { command.attributes |= UIMenuElementAttributesDisabled; } } else { [super validateCommand:command]; } } Now add a validateCommand: to each of your root view controller classes. It should validate each of its own commands as needed. Call super for all other commands. Tedious but straight forward.
Topic: UI Frameworks SubTopic: UIKit
Replies
Boosts
Views
Activity
Aug ’25
Reply to Is there a tech note for menuBuilder?
That last paragraph was very helpful. I hadn’t realized I should be using canPerformSelector for most of the logic I currently have in validateCommand. It makes sense now that you point it out.
Topic: UI Frameworks SubTopic: UIKit
Replies
Boosts
Views
Activity
Aug ’25
Reply to UISearchController scope buttons disappear forever after dismissing search when embedded in a search tab
I filed two related UISearchBar scope button bug reports against beta 1. Still not fixed as of beta 5. Though earlier today I found a work around that might work in your case too. Set the search controller scopeBarActivation to .manual. Set the controller’s delegate. In the didPresentSearchController delegate method, call setShowScope(true, animated: true) on the search bar. In the willDismissSearchController delegate method, call setShowScope(false, animated: true) on the search bar. The latter one is key. The result looks slightly clunky but at least the scope buttons appear more than once.
Topic: UI Frameworks SubTopic: UIKit Tags:
Replies
Boosts
Views
Activity
Aug ’25
Reply to UISearchController cannot become first responder when switching to a search tab
Instead of trying to make the search bar the first responder, activate the search controller with isActive = true. Try that in viewWillAppear or viewIsAppearing.
Topic: UI Frameworks SubTopic: UIKit Tags:
Replies
Boosts
Views
Activity
Aug ’25
Reply to NSUserDefault In release mode, the values are missing
The values stored in NSUserDefaults are kept in a file in the app’s sandbox. If you delete the app, the sandbox is deleted too. There is no expectation that user default values will exist when freshly installing a new app. Have a look at the NSUserDefaults registerDefaults: method. You may find it useful.
Topic: App & System Services SubTopic: General Tags:
Replies
Boosts
Views
Activity
Aug ’25
Reply to 'editButtonItem.title' Cannot Be Updated in iOS 26
The simplest solution is to avoid using editButtonItem and create your own UIBarButtonItem that does the same thing. Then you can style it anyway you want and set the titles to what you want. The stock button simply toggles isEditing: setEditing(!isEditing, animated: true)
Topic: UI Frameworks SubTopic: UIKit
Replies
Boosts
Views
Activity
Aug ’25
Reply to iOS 26 Beta 6 in Simulator
Presumably Xcode 26 beta 6 will be released next Tuesday and that should support iOS 26 beta 6. It’s unusual that Apple released iOS 26 beta 6 only a week after beta 5 and likely a week before Xcode 26 beta 6 comes out. In short, no there is no iOS 26 beta 6 simulator yet.
Replies
Boosts
Views
Activity
Aug ’25
Reply to Is there a tech note for menuBuilder?
I looked into migrating some of my existing validateCommand: code into canPerformAction:sender: and I hit a roadblock. In one of my cases I use the same selector for a whole set of menus. I use the command’s propertyList value to act accordingly. This is fine in validateCommand: since I have access to the command. But in canPerformAction:sender I only get the selector. The sender is a private type called _UIMenuBarItem. I can see in the debugger that there is a reference to the command and the propertyList but there’s no public API to get to either. BTW - that is the result while testing the Mac Catalyst version of the app.
Topic: UI Frameworks SubTopic: UIKit
Replies
Boosts
Views
Activity
Aug ’25
Reply to Setting Tint Color for Prominent Style UIBarButtonItems at App Level in iOS26
@anils can you clarify what you are trying to demonstrate with your post? It’s well known that setting the tintColor of individual buttons can done. The question is about setting the tint color at a higher level like has been done for many many years before iOS 26.
Topic: UI Frameworks SubTopic: UIKit Tags:
Replies
Boosts
Views
Activity
Aug ’25
Reply to Toolbar tint color with Liquid Glass
There are several existing discussions on this bug. Many people have filed bug reports since beta 1. So far it seems as if Apple really wants black and white interfaces starting with iOS 26. The tintColor of UIBarButtonItem can work in some cases. Basically only for prominent buttons not made with a custom view. Feel free to file a bug report. Maybe one more will be enough for Apple to fix the problem.
Topic: UI Frameworks SubTopic: General
Replies
Boosts
Views
Activity
Aug ’25
Reply to Summary of iOS/iPadOS 26 UIKit bugs related to UISearchController & UISearchBar using scope buttons
None of these issues are resolved in iPadOS 26 beta 8.
Topic: UI Frameworks SubTopic: UIKit Tags:
Replies
Boosts
Views
Activity
Aug ’25
Reply to Setting Tint Color for Prominent Style UIBarButtonItems at App Level in iOS26
@HarrisRap Can you clarify what exactly appears to be fixed? And I assume you mean in beta 8. None of my tinting/coloring issues appear to be fixed when tested on an iPad with iPadOS 26 beta 8.
Topic: UI Frameworks SubTopic: UIKit Tags:
Replies
Boosts
Views
Activity
Aug ’25
Reply to Building macOS apps with Xcode 26 on macOS 26 VM
Getting this fixed now is almost pointless. In two weeks the GM for macOS 26 likely will be out. We needed this fixed months ago so we could test the beta macOS while using a stable macOS. Maybe we’ll get lucky and by next June we’ll be able to test macOS 27 beta using macOS 26.6.3 and Xcode 26.4.
Replies
Boosts
Views
Activity
Aug ’25
Reply to iOS26 UISearchbar and UISearchController cancellation issues
The documentation for showsCancelButton clearly states that this property is ignored on an iPad so that is expected behavior. So this means that tapping the little x icon causing the search to be cancelled is, unfortunately, also expected. A Mac Catalyst version of a UIKit app has always had this undesired behavior. It seems Apple is making the iPad version work the same. It’s a poor choice in my opinion. File a request via Feedback Assistant asking for it to be changed. There are many bugs in iOS 26 related to UISearchBar. I’ve filed at least 3 separate bug reports and Apple doesn’t seem to care since none have been fixed. 2 of my reports were filed against beta 1. And my reports are about clearly broken functionality, not just things I would prefer to behave differently. But you should file your own bug reports for any incorrect or undesired behavior. Apple needs to know that things don’t work and that they are affecting people’s apps. Here’s a post I made summarizing the issues I’m still facing: https://developer.apple.com/forums/thread/797701
Topic: UI Frameworks SubTopic: UIKit Tags:
Replies
Boosts
Views
Activity
Aug ’25