这是我的测试脚本代码段。我在尝试将元组分配给常量的行上遇到编译错误。
class Test: UIView {
struct Properties {
var properties: (coordinatesXY: CGPoint, radius: CGFloat, group: String, fillingColor: UIColor)
}
var circleCollection: [Properties] = []
private func getProperties() -> [Properties] {
return circleCollection
}
private func getShape(circleProperties properties: Properties) {
let (coordinatesXY, radius, group, fillingColor) = properties
//Error: Expression type 'Test.Properties' is ambiguous without more context
}
private func drawTheme(circleProperties properties: Properties) {
getShape(circleProperties: properties)
}
private func drawMainTheme () {
let properties = getProperties()
for record in 0...properties.count {
drawTheme(circleProperties: properties[record])
}
}
}
非常感谢这里的任何帮助,非常感谢提前!