0
我想知道如何将名称值“ok”和“123”放入第一个数组,这是[“here”]我希望其他数组为空。如何将特定值放入数组数组中的一个元素
import Foundation
import CoreLocation
class Spot {
let name: String
let location: CLLocation
init (lat: CLLocationDegrees, lng: CLLocationDegrees, name: String = "") {
self.location = CLLocation(latitude: lat, longitude: lng)
self.name = name
}
}//class
extension Spot {
static var list: [Spot] {
return [
Spot(lat: 35.124585, lng: 135.154821, name: "ok"),
Spot(lat: 35.05406, lng: 136.215414, name: "123")
]
}
}
var array = [["here"],[],[],[],[],[]]
对于迟到的回复感到抱歉。非常感谢你,我可以达到我想要的。再次感谢你!! – Daibaku
不客气,我很高兴它帮助你 –