call method in a subclass of UIView

Posted by rdesign on Stack Overflow See other posts from Stack Overflow or by rdesign
Published on 2010-03-24T10:39:04Z Indexed on 2010/03/24 10:43 UTC
Read the original article Hit count: 345

Filed under:
|
|
|
|

Hey,

I've got a UIViewController and an own class, a subclass of UIView.

In my ViewController I make a instance of the uiview. If I tap the uiview a function gets called within it and an overlay appears. TO get rid of that overlay later the user has to tap somewhere on the screen(besides the instance of my class)

How do I tell my class to dismiss the overlay? I already thought of delegate.

So my thoughts were to make a MyUIViewControllerdelegate. If my viewcontroller receives a tap the delegate should be called. THe only problem is how do I tell my subclass that it should receive that delegate? I Have no instance of my viewcontroller in my subclass so I can not set the delegate.

Any Ideas? Hope my problem is clear :)

Thanks a lot

© Stack Overflow or respective owner

Related posts about delegate

Related posts about iphone