ios - Reuse UIButton style -


i've got couple of uibuttons same style, have different colors , have different widths. however, hate make seperate class new button needs different color, thought there must way style button , take, instance, color , height property. after image work importing uitableview's datasource/delegate.

so more concrete question: there way make class uibutton takes parameters such width , height, , possible declare kind of class uibutton?

that's no problem @ all. create category or subclass of uibutton. define custom init method - (instancetype)initwithcolor:(uicolor *)color size:(cgsize)size. in init method call self = [super initwithframe:cgrectzero] , set properties on self.


Comments

Popular posts from this blog

java - How to specify maven bin in eclipse maven plugin? -

single sign on - Logging into Plone site with credentials passed through HTTP -

php - Why does AJAX not process login form? -