doing animations

This commit is contained in:
Max Sokolov 2016-05-26 02:27:58 +03:00
parent 3f54cacab0
commit 82fce34c2e
3 changed files with 12 additions and 2 deletions

View File

@ -113,6 +113,11 @@ public class TableBaseRowBuilder<DataType, CellType where CellType: UITableViewC
// MARK: - Items manipulation -
public func remove(index index: Int, animated: UITableViewRowAnimation) {
//tableDirector?.tableView?.deleteRowsAtIndexPaths(<#T##indexPaths: [NSIndexPath]##[NSIndexPath]#>, withRowAnimation: <#T##UITableViewRowAnimation#>)
}
public func item(index index: Int) -> DataType {
return items[index]
}

View File

@ -84,8 +84,8 @@ public class TablePrototypeRowBuilder<DataType: Hashable, CellType: Configurable
}
public override func willUpdateDirector(director: TableDirector?) {
super.willUpdateDirector(director)
//tableDirector = director
if let tableView = director?.tableView, cell = tableView.dequeueReusableCellWithIdentifier(reusableIdentifier) as? CellType {
prototypeCell = cell
}

View File

@ -21,11 +21,16 @@ class MainController: UIViewController {
override func viewDidLoad() {
super.viewDidLoad()
let rows = TableRowBuilder<String, StoryboardImageTableViewCell>(items: ["1", "1", "1", "1"])
let rows = TablePrototypeRowBuilder<String, StoryboardImageTableViewCell>(items: ["1", "1", "1", "1"])
.action(.click) { [unowned self] e in
self.performSegueWithIdentifier("headerfooter", sender: nil)
}
let rows2 = TablePrototypeRowBuilder<String, StoryboardImageTableViewCell>(items: ["1", "1", "1", "1"])
rows.remove(index: 0, animated: .None)
tableDirector += rows
tableDirector += rows2
}
}