我的UITableView有兩個部分,所以我創建了他們的枚舉:如何斯威夫特
private enum TableSections {
HorizontalSection,
VerticalSection
}
如何與「部分」開關VAR在numberOfRowsInSection通過委託方法?看來我需要爲我的枚舉類型投下「部分」?還是有更好的方法來完成這個?
被「枚舉案‘HorizontalSection’的類型不‘詮釋’發現的錯誤。
override func tableView(tableView: UITableView, numberOfRowsInSection section: Int) -> Int {
switch section {
case .HorizontalSection:
return firstArray.count
case .VerticalSection:
return secondArray.count
default
return 0
}
}
可以使用原始值。 – tktsubota