How do I change the tint color of a UISwitch on macOS

Asked on 08/02/2024

1 search

To change the tint color of a UISwitch on macOS, you can refer to the session "Extend your app’s controls across the system" from WWDC 2024. Specifically, you can provide a tint color to customize the appearance of the control. Here is a relevant excerpt from the session:

Instead of the default system blue, provide a tint color. I'll use the color of my productivity app purple purple for productivity. The tint color will be used to tint the symbol when the toggle is on. Here's the fully styled control working on the lock screen and with the action button using the same code that makes it work in control center when the control is on. The symbol and any value text have the specified tint color.

For more detailed information, you can watch the session starting from the chapter "Update toggle states" here.