I work on an App that uses Live Activities and shows a countdown. We want to use it without the seconds. We are currently using Text(getDate(), style: .relative)
. Is there a new method in Swift to show the countdown on a Live Activity without seconds being displayed.
Live Activities
I think I found a solution but it's not working.
Text(.now, format:.timer(countingDownIn: Date.now..<Date.now.addingTimeInterval(120),
showsHours: true,
maxFieldCount: 2,
maxPrecision: .seconds(60))
)
This will display "2 minutes" but after waiting over a minute it never updates to "1 minute" This is new to iOS18. I will submit a bug.