Pick the fix
You need to know when an AVPlayerItem becomes ready to play. Best approach?
Hint 1 of 1
KVO returns a token.
Choose an answer, then open Show answer below to check it.
Show answer
Answer: A Store item.observe(\.status, options: [.new]) { item, _ in … } in a property
Correct. That's the block KVO API, and the stored token keeps it alive.
Why not the others?
- B Use didSet on item.status. You can't add observers to another type's property.
- C Poll item.status with a Timer. It's wasteful and laggy.
- D Call observe and ignore the return value. The observation ends immediately.