0

I am implementing timer on lock screen widget using Timer.publish and .onReceive on Text. But the timer is not firing. let timer = Timer.publish(every: 1, on: .main, in: .common).autoconnect()

I have a Text() in ZStack which I want to update.

1
  • Please clarify your specific problem or provide additional details to highlight exactly what you need. As it's currently written, it's hard to tell exactly what you're asking. Commented Nov 11, 2022 at 13:29

1 Answer 1

1

Widgets are static, your app sends an encoding of the View structs to the lock screen so none of the actions work. However, there are ways to request a refresh, see Keeping a Widget Up To Date | Apple Developer Documentation

Sign up to request clarification or add additional context in comments.

Comments

Your Answer

By clicking “Post Your Answer”, you agree to our terms of service and acknowledge you have read our privacy policy.

Start asking to get answers

Find the answer to your question by asking.

Ask question

Explore related questions

See similar questions with these tags.