开发者

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 som开发者_如何学运维e kind of delegate method for a UIView.


NOTE: I am not using a UIViewController


There is no delegate method but you can override,

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


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


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.

0

上一篇:

下一篇:

精彩评论

暂无评论...
验证码 换一张
取 消

最新问答

问答排行榜