@objc

122 阅读1分钟

添加@ o b j c 才可以使用 K V C s w i f t

class pointModel:NSObject{

@objc var tagPoint:CGPoint = CGPoint(x: 7.0, y: 6.0)

}

let point = NSValue(cgPoint: CGPoint(x: 8.0, y: 9.0))

let model = pointModel()

model.setValue(point,forKey:"tagPoint")