【发布时间】:2015-12-04 17:26:32
【问题描述】:
Apple 的 2015 年 WWDC 面向协议的 Swift 会议中的这行代码有什么作用?
var draw: (CGContext)->() = { _ in () }
可以在此处找到演示游乐场的 Swift 2.1 版本和使用这行代码的文件:https://github.com/alskipp/Swift-Diagram-Playgrounds/blob/master/Crustacean.playground/Sources/CoreGraphicsDiagramView.swift
我试图了解如何为所有 Drawable 调用 CGContextStrokePath(context)。
【问题讨论】: