Reputation: 19310
I am building a custom control, in which I want to register control (subclass of UIButton
) for notification when it is loaded, and unregister when UIView
is unloaded.
I have searched a lot, and found numerous methods for UIViewController's
life cycle but not for simple UIView.Can
you provide methods when I can determine start and end of UIView
Upvotes: 1
Views: 803
Reputation: 808
What about registering for notifications when the control is created (with initWithFrame and initWithCoder) and deregistering when the control is destructed (in dealloc). You can then check for self.window at every notification to see if the control is visible.
Upvotes: 1