3
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
})
谢谢,似乎很详细,但它终于工作 –