Post

Replies

Boosts

Views

Activity

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 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 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 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 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 Setting Tint Color for Prominent Style UIBarButtonItems at App Level in iOS26
Another beta release and another round of disappointment. Not a single tint/color related issue was fixed in the beta 5. Two months of beta testing and Apple seems to want all of us to deliver purely black and white user interfaces. That or they are abandoning UIKit. I have a dozen open iOS 26 UIKit bugs. Many since beta 1. All include trivial sample apps that demonstrate the issue. And I’m talking about flat out broken behavior, not just things I wish were different. So frustrating.
Topic: UI Frameworks SubTopic: UIKit Tags:
Aug ’25
Reply to Unable to Tint Custom View in UIBarButtonItem on iOS 26
This has been an issue since iOS 26 beta 1. I filed a bug report then. Please do the same using the Feedback Assistant app. There are actually quite a few issues related to tinting bar button items in iOS 26. I've filed 4 separate bug reports so far (just for different tinting issues). Apple just doesn't seem to care about fixing basic UIKit bugs in iOS 26. It's frustrating. And every beta update introduces new issues related to colors. (sorry for the rant).
Topic: UI Frameworks SubTopic: UIKit Tags:
Jul ’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 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 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 '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 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 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 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 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 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?
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 Setting Tint Color for Prominent Style UIBarButtonItems at App Level in iOS26
Another beta release and another round of disappointment. Not a single tint/color related issue was fixed in the beta 5. Two months of beta testing and Apple seems to want all of us to deliver purely black and white user interfaces. That or they are abandoning UIKit. I have a dozen open iOS 26 UIKit bugs. Many since beta 1. All include trivial sample apps that demonstrate the issue. And I’m talking about flat out broken behavior, not just things I wish were different. So frustrating.
Topic: UI Frameworks SubTopic: UIKit Tags:
Replies
Boosts
Views
Activity
Aug ’25
Reply to A bug in iOS 26 on UISegmentedControl
This is not the place to report bugs. Use the Feedback Assistant app to report issues to Apple. Be sure you include a clear explanation of the issue and a simple test app that demonstrates the problem.
Topic: UI Frameworks SubTopic: UIKit
Replies
Boosts
Views
Activity
Jul ’25
Reply to Building macOS apps with Xcode 26 on macOS 26 VM
I updated my host to 15.6. I then crested a new macOS 26 guest. Installed Xcode 26 beta 4. Created a new test project. Added the iCloud capability and then I ran into the same issue - unable to add the device (the guest Mac) via automatic provisioning. Bummer.
Replies
Boosts
Views
Activity
Jul ’25
Reply to How to customize UIActivityViewController
Maybe they are not using UIActivityViewController. It's not that hard to recreate the same user interface (I've done it myself, mostly). Then you have full control over what appears.
Topic: UI Frameworks SubTopic: UIKit Tags:
Replies
Boosts
Views
Activity
Jul ’25
Reply to Unable to Tint Custom View in UIBarButtonItem on iOS 26
This has been an issue since iOS 26 beta 1. I filed a bug report then. Please do the same using the Feedback Assistant app. There are actually quite a few issues related to tinting bar button items in iOS 26. I've filed 4 separate bug reports so far (just for different tinting issues). Apple just doesn't seem to care about fixing basic UIKit bugs in iOS 26. It's frustrating. And every beta update introduces new issues related to colors. (sorry for the rant).
Topic: UI Frameworks SubTopic: UIKit Tags:
Replies
Boosts
Views
Activity
Jul ’25