what is protocol? . The use of protocol?

Answer Posted / babu

Protocol is the named list of independent methods. Protocol declaration having two sections

@required

In this section you will declare all required methods. If a class adopting this protocol should implement all required methods

@optional

In this section you will declare all optional methods.

Eg: @protocol myViewProtocol

@required

-(void)passDataToNextClass : (NSString*)myViewName

@optional

-(void)passDataToNextClass : (NSString*)myViewName

@end

Is This Answer Correct ?    0 Yes 0 No



Post New Answer       View All Answers


Please Help Members By Posting Answers For Below Questions

Do you know what are layer objects and what do they represent?

480


What is called before viewdidload?

466


What is dynamic typing in iOS operating system?

479


Mention the short-cut to edit variables in Scope?

484


Is ios development hard?

492






What is id in ios?

457


What is ios image?

411


What is nspersistentstore? Is it thread safe?

524


what are all instruments available in Xcode?

489


Will the new design mean I have to completely relearn how to use my phone?

416


What is block in ios objective c?

458


What are the features of ios?

419


Explain Apple push notification

1035


What is difference between mvc and mvvm in ios?

447


What is protocol in ios swift?

456