update task

This commit is contained in:
Max Sokolov 2016-05-30 01:02:36 +03:00
parent 4bda514277
commit bdf009b980
2 changed files with 16 additions and 12 deletions

View File

@ -52,11 +52,6 @@ public class TableDirector: NSObject, UITableViewDataSource, UITableViewDelegate
}
public func row<T>(row: T) -> T {
return row
}
// MARK: Private methods

View File

@ -9,6 +9,11 @@
import UIKit
import Tablet
class TableUpdateTask {
}
class MainController: UIViewController {
@IBOutlet weak var tableView: UITableView! {
@ -28,24 +33,28 @@ class MainController: UIViewController {
let rows2 = TableRowBuilder<String, StoryboardImageTableViewCell>(items: ["1", "1", "1", "1"])
rowBuilder
.delete(indexes: [0], animated: .None)
.insert(["2"], atIndex: 0, animated: .None)
.update(index: 0, item: "", animated: .None)
.move([1, 2], toIndexes: [3, 4])
let section = TableSectionBuilder(headerTitle: "", footerTitle: "", rows: [rowBuilder])
//tableView.moveRowAtIndexPath(<#T##indexPath: NSIndexPath##NSIndexPath#>, toIndexPath: <#T##NSIndexPath#>)
//tableView.deleteRowsAtIndexPaths(<#T##indexPaths: [NSIndexPath]##[NSIndexPath]#>, withRowAnimation: <#T##UITableViewRowAnimation#>)
//tableView.insertRowsAtIndexPaths(<#T##indexPaths: [NSIndexPath]##[NSIndexPath]#>, withRowAnimation: <#T##UITableViewRowAnimation#>)
//tableView.reloadRowsAtIndexPaths(<#T##indexPaths: [NSIndexPath]##[NSIndexPath]#>, withRowAnimation: <#T##UITableViewRowAnimation#>)
//tableView.moveSection(0, toSection: 0)
//tableView.reloadSections([], withRowAnimation: .None)
//tableView.deleteSections([], withRowAnimation: .None)
//tableView.insertSections([], withRowAnimation: .None)
tableDirector.performBatchUpdates {
rowBuilder
.delete(indexes: [0], animated: .None)
.insert(["2"], atIndex: 0, animated: .None)
.update(index: 0, item: "", animated: .None)
.move([1, 2], toIndexes: [3, 4])
}
tableDirector.append(section: section)