Suppose I make a UIViewController a UIScrollViewDelegate.
Do I need to implement all methods for the delegate, or can I just implement the 1 I care about?
Sign Up to our social questions and Answers Engine to ask questions, answer people’s questions, and connect with other people.
Login to our social questions & Answers Engine to ask questions answer people’s questions & connect with other people.
Lost your password? Please enter your email address. You will receive a link and will create a new password via email.
Please briefly explain why you feel this question should be reported.
Please briefly explain why you feel this answer should be reported.
Please briefly explain why you feel this user should be reported.
If you
cmd + clickin xcode where you have declared that you implement the protocolXcode will take you to the header file where the protocol is defined. Here you can see that all of the methods for
UIScrollViewDelegateare declared as@optionaltherefore you can just implement the ones you want.If you prefer the documentation then
Applemarks the required methods withrequired methodin theTaskssection.Additionally the compiler will show warnings if you say you conform to a protocol but do not implement required methods.