我想在swift中使用泛型以初始化Vector3D類中的變量。然而,在分配協議「數字」到我的變量(使它無論是雙人或浮動),我收到以下錯誤: Protocol 'Number' can only be used as a generic constraint because it has Self or associated type requirements public protocol Num
我有這樣的對象類 class City {
var name:String
init(name: String) {
self.name = name
}
var video:String?
var description:String?
var image_array:NSArray?
}
在這個類中有一個名爲im