can I make a live activity timer with formatting so it is only showing HH:mm ?
Generated on 7/31/2024
1 search
Yes, you can create a live activity timer with formatting to show only hours and minutes (HH:mm). In the session What’s new in SwiftUI, it is mentioned that text now has additional formats for the display of live times and dates that work great in widgets and live activities. These formats include date references, date offsets, and timers, and each format is deeply customizable down to its components.
For more detailed guidance on building and customizing live activities, you might also find the session Extend your app’s controls across the system helpful, where a productivity timer control is built and refined.
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.
Bring your Live Activity to Apple Watch
Bring Live Activities into the Smart Stack on Apple Watch with iOS 18 and watchOS 11. We’ll cover how Live Activities are presented on Apple Watch, as well as how you can enhance their presentation for the Smart Stack. We’ll also explore additional considerations to ensure Live Activities on Apple Watch always present up-to-date information.
Design Live Activities for Apple Watch
Starting in watchOS 11, Live Activities from your iOS app will automatically appear in the Smart Stack on a connected Apple Watch. Learn how to optimize the layout of your Live Activity for the wrist, and provide the right level of information and interactivity at the right time.
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.