aryaxt
aryaxt

Reputation: 77616

iphone UIView - Get notified when view has loaded?

I have a subclass of UIView, I want to be notified as soon as the view is loaded on the screen. Is there some kind of delegate method for a UIView.


NOTE: I am not using a UIViewController

Upvotes: 0

Views: 517

Answers (3)

Peter Sarnowski
Peter Sarnowski

Reputation: 11970

If you are not using OpenGL, you could use the - (void)drawRect:(CGRect)rect for that.

Upvotes: 0

railwayparade
railwayparade

Reputation: 5156

There is no delegate method but you can override,

- (void)didAddSubview:(UIView *)subview{
}

Upvotes: 4

spamboy
spamboy

Reputation: 32

Set the class which opens your view as the delegate of the view, then on viewDidLoad (which runs as soon as the view is opened, even if it's not by a viewController per se) notify the delegate. That should work, I believe.

Upvotes: -2

Related Questions