【发布时间】:2015-04-09 20:31:03
【问题描述】:
我希望我的视图中的表格视图始终可以重新排序。我无法弄清楚这一点。我的表格视图中有行,但无法显示重新排序句柄。
对于表格视图原型单元格,我确保在 Indentation > "Shows Re-order Controls" 中有一个检查,但这没有做任何事情。
这就是我整个班级的样子:
class ViewController: UIViewController {
...
@IBOutlet var currentTable: UITableView!
override func viewDidLoad() {
super.viewDidLoad()
// Do any additional setup after loading the view, typically from a nib.
currentTable.editing = true
}
func tableView(tableView: UITableView, numberOfRowsInSection section: Int) -> Int {
return unitCategories.count
}
func tableView(tableView: UITableView, cellForRowAtIndexPath indexPath: NSIndexPath) -> UITableViewCell {
let cell = UITableViewCell(style: UITableViewCellStyle.Default, reuseIdentifier: "Cell")
cell.textLabel?.text = "\(unitCategories[indexPath.row])"
return cell
}
/*func tableView(tableView: UITableView, editingStyleForRowAtIndexPath indexPath: NSIndexPath) -> UITableViewCellEditingStyle {
return UITableViewCellEditingStyle.None
}*/
}
有人可以帮我指出正确的方向吗?
【问题讨论】:
标签: ios uitableview swift xcode6