Think of the getter of the bounds property as "calculateWhatMyBoundsRectIs". So it makes sense to assign CGFloat x = myView.calculateWhatMyBoundsRectIs.x, but not myView.calculateWhatMyBoundsRectIs.x = 50.0.
The setter is more like "recalculateMySizeBasedOnThisNewBoundsRect". myView.recalculateMySizeBasedOnThisNewBoundsRect = myNewCGRect is ok, but myView.recalculateMySizeBasedOnThisNewBoundsRect.x = 50.0 doesn't jive.
This boils down to an incomplete, or inconsistent, implementation in the compiler. Conceptualizing away the underlying problem is easy to do but I think they simply dropped the ball, especially in the context of choosing to use dot syntax for properties.
3 Comments:
I don't understand why not? (Not questioning your correctness, just hoping for an explanation.)
Think of the getter of the bounds property as "calculateWhatMyBoundsRectIs". So it makes sense to assign CGFloat x = myView.calculateWhatMyBoundsRectIs.x, but not myView.calculateWhatMyBoundsRectIs.x = 50.0.
The setter is more like "recalculateMySizeBasedOnThisNewBoundsRect". myView.recalculateMySizeBasedOnThisNewBoundsRect = myNewCGRect is ok, but myView.recalculateMySizeBasedOnThisNewBoundsRect.x = 50.0 doesn't jive.
This boils down to an incomplete, or inconsistent, implementation in the compiler. Conceptualizing away the underlying problem is easy to do but I think they simply dropped the ball, especially in the context of choosing to use dot syntax for properties.
Post a Comment
<< Home