Control Widget Details?

I'm really struggling to get a handle on all the different aspects of Control Widgets. I wish the docs led with comprehensive visual examples.

I'm trying to make a Control Widget that shows the user a quick status of something (on or off), and lets the user change that status, but when they turn it off, it can be turned off for a period of time. I want to present some options in a manner similar to the Focus widget.

When you first display widets on macOS, you get this:

On the Focus widget, see how it has a round button with a moon, the word "Focus", and a disclosure chevron? I want to reproduce that. If you click the moon button, it turns that focus mode on. If you click anywhere else, it shows this:

And even those controls are quite fancy, expanding when you click on them.

How do I get that second level of UI?

Answered by JetForMe in 895174022

It seems all that functionality showcased in Control Center by Apple widgets is reserved for Apple only.

I’m so fed up with this from Apple. Introduce a poorly-documented API, we see examples of how it can work, only to find out no, we don’t get to do the same things.

On iOS it’s even worse. A long-press on the Camera control brings up a popup menu with four camera modes to enter. A long-press on the Timer control bings up a fancy full-screen UI to let the user choose a duration for a new timer.

All I can do is let the user pre-configure several buttons with the options I want to offer, or open my app for them, which defeats the purpose of the control widget.

Apple could've spent time enhancing this API, but instead gave us yet another new look and feel that adds effort for us and gives users no benefit.

Accepted Answer

It seems all that functionality showcased in Control Center by Apple widgets is reserved for Apple only.

I’m so fed up with this from Apple. Introduce a poorly-documented API, we see examples of how it can work, only to find out no, we don’t get to do the same things.

On iOS it’s even worse. A long-press on the Camera control brings up a popup menu with four camera modes to enter. A long-press on the Timer control bings up a fancy full-screen UI to let the user choose a duration for a new timer.

All I can do is let the user pre-configure several buttons with the options I want to offer, or open my app for them, which defeats the purpose of the control widget.

Apple could've spent time enhancing this API, but instead gave us yet another new look and feel that adds effort for us and gives users no benefit.

Control Widget Details?
 
 
Q