Initial import of iOS 5 version.
Adjustments for iOS6.