Search code examples
objective-ciosuiviewnsnotificationcenternsnotifications

Receive notification on adding subview



Hello,
For example, I have a view, on that view there is a scrollview. Is it possible to know, when any subview has been added on that scrollview without subclassing the UIScrollView and overriding the method didAddSubview:?
Basically, is it possible to receive notifications when the number of subviews has been changed?
Thanks.


Solution

  • You could use a Category as well to redefine didAddSubview: