【发布时间】:2019-08-27 11:20:25
【问题描述】:
想在数组中的元素处打印字符串
var twoDimensionalArray = [
ExpandableNames(isExpanded: false, names: ["Antiques",
"Art",
"Collectables",
"Other Antiques , Art & Collectables"]),
ExpandableNames(isExpanded: false, names: ["Baby Carriers",
"Baby Clothing",
"Baths",
"Safety"]),
]
override func tableView(_ tableView: UITableView, didSelectRowAt indexPath: IndexPath) {
let mm = twoDimensionalArray[indexPath.row]
if indexPath == [1,1]{
print("this is mm:",mm)
}
}
//打印语句打印
mm is: ExpandableNames(isExpanded: true, names: ["Baby Clothing","Baths","Safety"])
我只想让它打印“婴儿背带”
【问题讨论】:
标签: swift xcode didselectrowatindexpath