-
Notifications
You must be signed in to change notification settings - Fork 2
Open
Labels
Description
Fix this code and add this animations:
func animateTable(tableView: UITableView) {
tableView.reloadData()
let cells = tableView.visibleCells
let tableHeight: CGFloat = tableView.bounds.size.height
for i in cells {
let cell: UITableViewCell = i
cell.transform = CGAffineTransformMakeTranslation(0, tableHeight)
}
var index = 0
for a in cells {
let cell: UITableViewCell = a
UIView.animateWithDuration(1.5, delay: 0.05 * Double(index), usingSpringWithDamping: 0.8, initialSpringVelocity: 0, options: [], animations: {
cell.transform = CGAffineTransformMakeTranslation(0, 0);
}, completion: nil)
index += 1
}
}
func animateXCellTableView(tableView: UITableView) {
tableView.reloadData()
let cells = tableView.visibleCells
for i in cells {
let cell: UITableViewCell = i
cell.frame.origin.x = tableView.frame.width
}
var index = 0
for a in cells {
let cell: UITableViewCell = a
UIView.animateWithDuration(1.0, delay: 0.05 * Double(index), usingSpringWithDamping: 0.8, initialSpringVelocity: 0, options: [], animations: {
cell.frame.origin.x = 0
}, completion: nil)
index += 1
}
}