If I add a view as a subview like so
[self.view addSubview:mySubview];
Will there be called any method on mySubview, that I could override to add some custom behavior?
To add a subview to another view, call the addSubview(_:) method on the superview.
A superview is a view that holds other views over it and subviews are the views being held/added over a View.
Adding a view to a (new) superview triggers
- (void)willMoveToSuperview:(UIView *)newSuperview
and
- (void)didMoveToSuperview
.
See the UIView Reference for more.
If you love us? You can donate to us via Paypal or buy me a coffee so we can maintain and grow! Thank you!
Donate Us With