在Xcode8学习中,还存在很多没有及时更改,残留的Swift2的语法,例如:

本次CGContextSetTextDrawingMode(context, CGTextDrawingMode.stroke)已经进化为context!.setTextDrawingMode(CGTextDrawingMode.stroke)

当然,注意在写Cocoa Touch Class时,在swift3中底部会有提示性的注释,

所以注意案例中的drawRect(rect:CGRect)早已更换成draw(_ rect:CGRect)
网友评论