【发布时间】:2019-05-11 10:35:53
【问题描述】:
我正在尝试创建汽车品牌和型号的集合。我希望能够在 Swift 中打印我收藏中的所有品牌或我收藏中的所有模型。提前致谢。
我已经能够创建一小部分汽车品牌和模型,但我正在努力完成打印其中某些部分的最后部分。
struct Section {
var make: String!
var model: [String]!
}
var Cars = [
Section(make: "BMW", model: ["A","B","C"]),
Section(make: "Ford", mode: ["D","E","F"])
]
//Print a list of all makes
//Print a list of all models
【问题讨论】:
标签: arrays swift struct printing