Closed kastiglione closed 11 years ago
We observe self
all the time. I don't see any problem with it in theory or practice.
Why do you feel like it's strange?
Yeah, I figured it was just me. I say "strange" because I've always known observing as technique for external objects to employ. Observing self
feels like speaking of oneself in the third person. It's not that I thought there would be problems. Thanks for confirming.
I think it's comparable to subscribing to a signal on self
, since properties are signals under RAC.
That is a helpful perspective.
In order to do validation, I'm creating an
isValid
signal property on the view model. The signal is created the usual way with-combineLatest:reduce:
with the input signals beingRACObserve(self, propertyNameX)
. It seems strange to be observingself
, but it also seems to be a necessary approach. Is this the way to do it, or is there a better way?EDIT: Related to #2.