how can I show audio playback controls on the Lock Screen?

Asked on 2024-07-30

1 search

To show audio playback controls on the Lock Screen, you can use the new controls feature introduced in iOS 18. Controls are a new type of widget that can be placed in various system spaces, including the Lock Screen. They are built using WidgetKit and can perform actions or toggle states.

Here's a brief overview of how you can create and configure these controls:

  1. Define the Control: Use WidgetKit to create a control, which can be a button or a toggle. You will need to provide a symbol, title, tint, color, and any additional content.

  2. Configure the Control: Make the control user-configurable so that users can add it to the Lock Screen. You can also customize the control's display name and description.

  3. Add to Lock Screen: Once configured, users can add the control to their Lock Screen through the controls gallery.

For a detailed guide on building and configuring controls, you can refer to the session Extend your app’s controls across the system.

Relevant Sessions