【发布时间】:2015-06-26 10:51:08
【问题描述】:
public struct Style {
public var test : Int?
public init(_ build:(Style) -> Void) {
build(self)
}
}
var s = Style { value in
value.test = 1
}
在声明变量时出错
Cannot find an initializer for type 'Style' that accepts an argument list of type '((_) -> _)'
有谁知道为什么这不起作用,对我来说似乎是合法代码
为了记录,这也行不通
var s = Style({ value in
value.test = 1
})
【问题讨论】: