how do I create a new control widget
Asked on 2024-07-30
1 search
To create a new control widget, you can follow the steps outlined in the session "Extend your app’s controls across the system" from WWDC 2024. Here is a summary of the process:
-
Introduction to Controls:
- Controls are a new type of widget in iOS 18, created using WidgetKit.
- They provide quick access to actions from your app and can be placed in system spaces like Control Center, the lock screen, and the action button.
- There are two types of controls: buttons (perform discrete actions) and toggles (change a piece of boolean state).
-
Building a Control:
- Start by adding a control entry into your existing widget bundle.
- Define the control in the widget extension by conforming to the
ControlWidgetprotocol. - Provide the necessary information for the control, such as a unique identifier, title, state, action to perform, and symbol image.
- Use an app intent to execute actions when the control is interacted with.
-
Configuring the Control:
- Begin with a static control configuration and add configurability later if needed.
- For configurable controls, use an
AppIntentControlConfigurationto manage the configuration. - Customize the display name and add a description for the control.
-
Refining the Control:
- Tailor the control style to the action it performs.
- Ensure the control features distinctive symbols and provides additional content as needed.
For a detailed walkthrough, you can refer to the session Extend your app’s controls across the system (03:11).
Relevant Sessions
- Extend your app’s controls across the system
- Bring your app’s core features to users with App Intents
These sessions provide comprehensive guidance on creating and configuring control widgets using WidgetKit and App Intents.

Build a great Lock Screen camera capture experience
Find out how the LockedCameraCapture API can help you bring your capture application’s most useful information directly to the Lock Screen. Examine the API’s features and functionality, learn how to get started creating a capture extension, and find out how that extension behaves when the device is locked.

Bring your app’s core features to users with App Intents
Learn the principles of the App Intents framework, like intents, entities, and queries, and how you can harness them to expose your app’s most important functionality right where people need it most. Find out how to build deep integration between your app and the many system features built on top of App Intents, including Siri, controls and widgets, Apple Pencil, Shortcuts, the Action button, and more. Get tips on how to build your App Intents integrations efficiently to create the best experiences in every surface while still sharing code and core functionality.

Extend your app’s controls across the system
Bring your app’s controls to Control Center, the Lock Screen, and beyond. Learn how you can use WidgetKit to extend your app’s controls to the system experience. We’ll cover how you can to build a control, tailor its appearance, and make it configurable.
