I'm looking for a way to add a padding
property to an UIView. Ideally, I would like to avoid subclassing and putting it in a category. The usage would be something like:
myview.padding = UIEdgeInsetsMake(10, 10, 10, 10);
And maybe have a paddingBox
property as well which would return a CGRect
describing the size and position of the inner padding box.
Now, how would one implement in a category something like that. I initially though of using bounds
, but unfortunately the size of the bounds
is linked to the size of the frame
(always the same) only the coordinates can differ.