twitter/twui — pull request #81 by jspahrsummers (2011-11-13 01:59:28+00:00)
Title: ARC Migration

High-level changes:

* Migrated framework project and sample project to ARC.
* Moved build settings identical across targets up to the project level.
* Enabled static analysis with every build.
* Enabled link-time optimization in release builds.

Specific source-level changes (besides trivial ARC migration fixes):

* Removed overridden release/retain logic from `TUIFastIndexPath` – necessary for ARC.
* Renamed `TUICGImageFromBitmapContext()` to `TUICreateCGImageFromBitmapContext()`, changing its memory management semantics in the process – necessary for ARC.
* Refactored `-[TUIImage innerShadowWithOffset:radius:color:backgroundColor:]` and `-[TUIImage embossMaskWithOffset:]` to not assign to `self` – necessary for ARC.
* Refactored how `TUIView` handles subviews, keeping them in an explicit array instead of relying on finding them as layer delegates. Not _strictly_ necessary for ARC, but this made the code a lot cleaner (and hopefully clearer) than otherwise.
* In `TUIGraphicsBeginImageContextWithOptions()` and `TUIGraphicsEndImageContext()`, expect `NSGraphicsContext` to retain the context, balancing our retain count for the static analyzer. If this is a faulty assumption, this change can be reverted.
* Removed deprecated `TUIFont` methods.

This was not exhaustively tested by any means (I don't have an existing project using TwUI), but both included projects build without issue, and the sample project runs without issue on 10.7.