swiftobjective-cuikitios26

UIBarButtonSystemItemDone shows blue checkmark and doesn't respect apperance's `tintColor` under iOS26


Creating a simple UIBarButtonItem on iOS26:

UIBarButtonItem *saveButton = [[UIBarButtonItem alloc] initWithBarButtonSystemItem:UIBarButtonSystemItemDone
                                                                              target:self
                                                                              action:@selector(save:)];
self.navigationItem.rightBarButtonItem = saveButton;

It shows the the new style and a checkmark with blue (system default) background.

In the AppDelegate, the tint color is set via appearance, however it's not applied.

UIColor *appTintColor = [UIColor appTintColor];
[UIBarButtonItem appearance].tintColor = appTintColor;
[UIButton appearance].tintColor = appTintColor;

I can force the tintColor to be set by adding the below when initializing the button.

saveButton.tintColor = [UIColor appTintColor];

It renders the button's checkmark almost translucent. enter image description here

Researched stackoverflow, tried out the above.


Solution

  • After some more research + trial and error, the culprit was the tintColor set on UButton.appearance .

    The button's checkmark is rendered correctly when setting this below globally and applying the tintColor on each UIBarButtonItem instance.

    if (@available(iOS 26, *)) {
            // do nothing;
        } else {
            [UIButton appearance].tintColor = appTintColor;
            [UIBarButtonItem appearance].tintColor = appTintColor;
        }
    }