关于CGContextSetTextDrawingMode

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


关于CGContextSetTextDrawingMode_第1张图片

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

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

关于CGContextSetTextDrawingMode_第2张图片

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

你可能感兴趣的:(关于CGContextSetTextDrawingMode)