Hi there,
I have a question in Chapter 8 for this code:
“var state = State.ready {
willSet {
willChangeValue(forKey: newValue.keyPath)
willChangeValue(forKey: state.keyPath)
}
didSet {
didChangeValue(forKey: oldValue.keyPath)
didChangeValue(forKey: state.keyPath)
}
}”
Excerpt From: “Concurrency by Tutorials.” iBooks.
My question is: How do we know there is a value for key “state.keyPath” and it is a Bool? I guess because there is a property like “isReady” for “Operation” class and the key is “isReady”? And that is why we need the “keyPath” property in Async Operation class to return in the format of “isReady”?
Thanks,
Mike