You can override the willMoveToSuperview:
or didMoveToSuperview
methods in a UIView
subclass in order to be informed when the view is added to another view.
about UIView addSubview
-
29-05-2022 - |
Question
I have two UIViews, named A and B, and I add UIView B into A's subviews:
[A.view addSubview B]
I am wondering is there any delegation or hook that B can be informed "Oh, I was added into A!" when it was added to A? or any other way to let B know it was added to some other UIView container?
La solution
Licencié sous: CC-BY-SA avec attribution
Non affilié à StackOverflow