0

How can I display something like: "Updated 4 minutes and 15 seconds ago" in my Widget?

Tesla has something like this, and I would really like to do this in my app aswell. This is what I am thinking about: https://www.notateslaapp.com/images/news/2021/tesla-app-3.jpg (Bottom right corner)

I know how to add Text(entry.date, style: .time) to display the current time, but how can I make it show time since updated? Tesla's widget updates the timer every single second. How can I accomplish this?

Amanda
  • 3
  • 1
  • Maybe only use single entry at a time and use one of the `Text` with `style` in it with the date the single entry was created. That might be `.relative` style or create a variable in your model for `var lastUpdated: Date` that is used in the `Text`. – lorem ipsum Dec 16 '21 at 22:40

0 Answers0