iOS: Detect when my UIView is add in other view

Viewed 14369
CustomView *customView = [...];
[self.view addSubview:customView];

I need to detect in my CustomView class when it is added in other views or when my superview changes.

3 Answers
  • For a UIView use - (void)didMoveToSuperview
  • For a UIViewController use -(void)viewWillAppear:(BOOL)animated
Related