forum

home / developersection / forums / how to create view delegate in ios

How to create view delegate in iOS

Anonymous User 1430 16-Dec-2015

I have create a delegate in our custom UIView, here is the code:

@protocol CustomViewDelegate
@optional
- (void) CustomViewDidInitialize:(CustomView *)customView;
@end

 

@interface CustomView : UIView {   
@private
}

@property(nonatomic, assign) id<CustomViewDelegate> delegate;

@end

The above code is not working because the CustomView interface has not been declared at the time of the CustomViewDelegate declaration.
So, now I tried it by adding a prototype ala C++ before the @protocol like this:

@interface FunView;

But it's also not solving my problem, so anyone have the solution then please tell me, thank you.


Updated on 17-Dec-2015

I am a content writter !

Can you answer this question?

Answer

1 Answers

Liked By