Daily iOS
Architecture

How KVO works

How does KVO in the Objective-C runtime detect property changes under the hood?

How would an interviewer hear this answer? You'll see whether they'd move on, dig in, or say no, and which sentences would trip you up. Your score doesn't change.
See the short answer

The runtime dynamically subclasses the observed object's class (isa swizzling) to intercept the setter and call willChange/didChange. New code replaces it with @Observable or Combine.

Share a question