I have already asked a question here Handling Multiple Xib or Fixing collapse and expand button on multiple Xib file then I thought to stop using multiple xib and only main xib
Yes it is possible using polymorphism. This is the idea that multiple classes can be sent the same message, (and potentially behave in different ways). You can create a class like: BaseViewController
that would have the definition for btnPupl:(id)sender
in the @interface
. This way any view controller that inherits from BaseViewController
will inherit btnPupl:(id)sender
.
Another option (I'd go with the first one) is to subclass UIButton
and implement the behaviour you want in that subclass.