How can I write a function that will take either a UIView or a UIButton as a parameter.
For example, let’s say I wanted to round the corners the View/Button:
[self roundCorners:x]
How could I make that accept both a UIButton object or a UIView object as x?
My first thoughts were use id or NSObject, but I don’t think that is correct:
-(void)roundCorners:(id)objectToRound;
UIButtonis a subclass ofUIView, so your method will take either one if you declare it this way: