Joined August 2013

James Tang

Focused iOS & UX Engineer
Hong Kong

Hi @gk, thanks for noting. That was a chance to configure your view controller such as passing a variable to your custom view controller. I've updated the code to make it more clear. Thanks!

Posted to Circle crop/mask on views over 1 year ago

Apple engineers does mention about performance on CALayer.cornerRadius, it's much faster on iOS 6, but yes it's still slow.

On other hand, -[UIView drawRect:] consumes CPU process, it's not as performant on retina devices. Technical wise, you'll also need to subclass your UIView, and in case you want to support different contentMode there'll be more work than expected.

Obviously there are several ways to circle masks. I'd consider this is good and simple enough for general use, and the beauty of this is developers will be able to define it in User Defined Runtime Attributes, that means you need to write zero lines of code when you're using IB to prototype your app, see the updated the post :)

Posted to Fast snapshot any views on iOS 7 over 1 year ago

Glad you like it :)

Posted to Force to use Legacy UI on iOS 7 apps over 1 year ago

No I didn't try, and as you said I don't recommended this for production use. However it's useful to preview your app back in iOS 6 environment on iOS 7 devices/simulator.

747 Karma
50,126 Total ProTip Views