addressalign-toparrow-leftarrow-rightbackbellblockcalendarcameraccwcheckchevron-downchevron-leftchevron-rightchevron-small-downchevron-small-leftchevron-small-rightchevron-small-upchevron-upcircle-with-checkcircle-with-crosscircle-with-pluscontroller-playcrossdots-three-verticaleditemptyheartexporteye-with-lineeyefacebookfolderfullheartglobegmailgooglegroupshelp-with-circleimageimagesinstagramFill 1light-bulblinklocation-pinm-swarmSearchmailmessagesminusmoremuplabelShape 3 + Rectangle 1ShapeoutlookpersonJoin Group on CardStartprice-ribbonprintShapeShapeShapeShapeImported LayersImported LayersImported Layersshieldstartickettrashtriangle-downtriangle-uptwitteruserwarningyahoo

The Charlotte iOS Developers Meetup Message Board › Setting property for class level

Setting property for class level

Sean R.
user 9537049
Charlotte, NC
Post #: 33
Is there a way to set a property, say background color, for the class so that every instance of that class automatically has that property set? For example, I set the backgroundcolor for a UIButton and every UIButton added to the project inherits the color set?
Neil S.
user 12282986
Charlotte, NC
Post #: 25
Not for UIButton itself but you could subclass UIButton and set the background property in your overridden init.
rachel p.
Charlotte, NC
Post #: 3
You could write a category to do it.
Sean R.
user 9537049
Charlotte, NC
Post #: 34
I ended up adding the following to the AppDelegate

[[UINavigationBar appearance] setTintColor:color];

Solved the issue I was trying to avoid of having to set the tintcolor on every controller.
Powered by mvnForum

Our Sponsors

People in this
Meetup are also in:

Sign up

Meetup members, Log in

By clicking "Sign up" or "Sign up using Facebook", you confirm that you accept our Terms of Service & Privacy Policy