Skip to content

Instantly share code, notes, and snippets.

@sai-prasanna
Created July 23, 2015 06:00
Show Gist options
  • Save sai-prasanna/ae12e6d6f81d2fcf4139 to your computer and use it in GitHub Desktop.
Save sai-prasanna/ae12e6d6f81d2fcf4139 to your computer and use it in GitHub Desktop.
Reload Tableview animation
extension UITableView {
func reloadDataAnimated(animated:Bool) {
reloadData()
if animated {
let animation = CATransition()
animation.type = kCATransitionPush
animation.subtype = kCATransitionFromBottom
animation.timingFunction = CAMediaTimingFunction(name: kCAMediaTimingFunctionEaseInEaseOut)
animation.fillMode = kCAFillModeBoth
animation.duration = 0.3
layer.addAnimation(animation, forKey: "UITableViewReloadDataAnimationKey")
}
}
}
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment