Pick the fix
Many unrelated screens must update when the user's subscription status changes. Best approach?
Hint 1 of 1
One change, many listeners.
Choose an answer, then open Show answer below to check it.
Show answer
Answer: A A shared @Observable store, injected through the environment, that screens read
Correct. Every screen that reads it updates automatically.
Why not the others?
- B A delegate on the store. Delegates are one-to-one.
- C Each screen polls a timer. It's wasteful and lags behind.
- D KVO on a Swift struct. KVO doesn't work on structs.