I have a data-driven method which creates and returns instances of various UIView subclasses. Depending on the input data, it currently returns UIButtons, UITextFields, UILabels, and my own subclass, with more subclasses likely to be added later.
I want to be able to add behavior to whatever I am returning. At present, this behavior consists of drawing a black border, but more, and possibly much more, is likely to become desirable later, as the requirements for my project become fleshed out. The added behavior will depend on the input data -- so at present, depending on the data, the border may or may not be drawn. I want to add this behavior once, in a single place, rather than have to do it separately in each subclass.
This is core functionality of what is likely to become a large project, so design cleanliness and performance are both important considerations.
What approach makes the most sense?