1.
discussions: http://stackoverflow.com/questions/4979192/ios-using-uiviews-drawrect-vs-its-layers-delagate-drawlayerincontext
2.
用到了:
-(void)drawLayer:(CALayer*)layer inContext:(CGContextRef)context
{ ... }
注释:Warning this method of drawing has a significant limitation; the UIKit drawing methods are not thread-safe, and thedrawLayer:inRect: callbacks come in on background threads, therefore you must use the CoreGraphics drawing functions instead of the UIKit drawing methods.
3.
感觉前者主要用于UI视图级的,比如控件,VIEW,或view的布局,修改等
后者:layer级的,在使用自己定义的layer时才用到,相当于缓存一级或矩阵算法,比前者更低一级。只能用CG***开头的函数,不用UIVIEW的子类