Created
July 23, 2015 06:00
-
-
Save sai-prasanna/ae12e6d6f81d2fcf4139 to your computer and use it in GitHub Desktop.
Reload Tableview animation
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
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