我有这样的代码:
form +++= SelectableSection<ImageCheckRow<String>, String>("branch_section", selectionType: .MultipleSelection) { section in
section.header = HeaderFooterView(title: "Branches")
}
for branch in sharedBranch.branchList {
form.last! <<< ImageCheckRow<String>(branch.name){ row in
row.title = branch.name
row.baseValue = branch.id
row.selectableValue = branch.name
row.value = nil
}
}但我找不到selectedRows,我试过:
let branch_section = self.form.sectionByTag("branch_section") as? SelectableSection<ImageCheckRow<String>, String>
print(branch_section)
print(branch_section.selectedRows())两种打印nil
发布于 2016-06-22 18:21:32
为了做到这一点,您需要使用这个
form +++= SelectableSection<ImageCheckRow<String>, String>("branch_section", selectionType: .MultipleSelection)
form.last!.header = HeaderFooterView(title: "Branches")
form.last!.tag = "branch_section"而不是
form +++= SelectableSection<ImageCheckRow<String>, String>("branch_section", selectionType: .MultipleSelection) { section in
section.header = HeaderFooterView(title: "Branches")
}然后你的代码
let branch_section = self.form.sectionByTag("branch_section") as? SelectableSection<ImageCheckRow<String>, String>
print(branch_section)
print(branch_section.selectedRows())我希望这对你有帮助
https://stackoverflow.com/questions/37680383
复制相似问题