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:
-
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.
-
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.
-
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

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.

Platforms State of the Union
Discover the newest advancements on Apple platforms.

What’s new in SwiftUI
Learn how you can use SwiftUI to build great apps for any Apple platform. Explore a fresh new look and feel for tabs and documents on iPadOS. Improve your window management with new windowing APIs, and gain more control over immersive spaces and volumes in your visionOS apps. We’ll also take you through other exciting refinements that help you make expressive charts, customize and layout text, and so much more.
