KVO for layer property of subview?

How do I do KVO for the bounds of a subview? I know I should go for the layer, but how do I get to the subview?


Lets use this example:

UIView *childView [[UIView allow] init];
[self.view addSubview:childView];


Should I start with "[self.view.layer addObserver..." and then make some magic in the keypath?


/BE

Replies

In general UIKit objects do not support KVO. Unless a class is documented as supporting KVO, you should assume it does not (even if it appears to work – there are likely edge cases that you haven't noticed).