Create a UIView Subclass that calls a delegate function whenever it's parent viewController appears?

Posted by Andrew Johnson on Stack Overflow See other posts from Stack Overflow or by Andrew Johnson
Published on 2010-03-14T23:27:55Z Indexed on 2010/03/14 23:35 UTC
Read the original article Hit count: 344

Filed under:
|
|

UIViewControllers have viewWillAppear, viewDidDisappear, etc. delegate methods.

I would like to create a UIView subclass that can be added to a viewController's view, and when that UIViewController apears or disappears, a delegate function is called.

I could easily do this by putting function calls in the UIViewController viewWillAppear/viewWillDisappear delegate functions, but how can I encapsulate this behavior in the UIView?

© Stack Overflow or respective owner

Related posts about iphone

Related posts about cocoa-touch