mrackwitz / MRProgress

Collection of iOS drop-in components to visualize progress
MIT License
2.55k stars 306 forks source link

MRCircularProgressView does not respond to appearance changes #48

Closed jdmunro closed 9 years ago

jdmunro commented 10 years ago

Using the "appearance" convention, e.g. using UI_APPEARANCE_SELECTOR:

If you change one of the MRCircularProgressView properties, e.g. borderWidth or lineWidth using the appearance proxy, the change will not take place. This is because there is a method called commonInit which changes these properties via their accessors which is called from the init method. This tricks the system into thinking we've already made customisations. The solution is to use the direct ivar variables when initially setting up the object to allow for subsequent modification using the appearance proxy.

More info here: http://petersteinberger.com/blog/2013/uiappearance-for-custom-views/ (see Lesson: Only use direct ivar access in the initializer for properties that comply to UI_APPEARANCE_SELECTOR)