I need to use the same set of code in 4 view controllers. I am writing this code in -(void)viewWillAppear.
Is there any possibility that I can write this code once and use it in all 4 view controllers?
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.
You could make a subclass of
UIViewControllerwith the common code, and then change each of your existingUIViewControllersubclasses to be a subclass of that new class.