github/twui — pull request #108 by galaxas0 (2012-10-14 02:12:45+00:00)
Title: TUIActivityIndicator Revamp!

The next control on my hitlist for revamping: `TUIActivityIndicatorView`! I've renamed it to `TUIActivityIndicator` to remove the explanatory `View` from its name, and I've added MANY features:

- Easy indicator drawing using the `indicatorFrame` property.
- Easy indicator animations using the `animations` array property - you can add or remove to the array, and it'll be automatically sorted out into a `CAAnimationGroup`, or you can replace it entirely. Just remember to call `refreshAnimations`, which refreshes animations without triggering a state change.
- Built in animations and frames ready to go! The default one is the gears, which I've drawn in pure Core Graphics.
- Animation speed property which allows for slower or faster activity indicator animations.
- The `layerProxy`, which I think is the coolest thing ever (and only slightly no-brainer): It lets you modify the `CALayer` of the indicator as it rotates. So for example, applying a shadow to the `layerProxy` would rotate the shadow as the indicator rotates, while applying it to the default `layer` would keep it stationary. I've illustrated this in the example code.