UITableViewCellAnimation
示例
要运行示例项目,请克隆仓库,然后首先从 Example 目录中运行 pod install
要求
- Xcode 9+
- Swift 4
安装
UITableViewCellAnimation 可以通过 CocoaPods 获得。要安装它,只需要将以下行添加到您的 Podfile 中
pod 'UITableViewCellAnimation'
UITableViewCellAnimation
UITableViewCellAnimation 是一个 Swift4 的动画集合,用于在 UITableViewCell 中执行动画。
示例
import UITableViewCellAnimation
func tableView(_ tableView: UITableView, willDisplay cell: UITableViewCell, forRowAt indexPath: IndexPath) {
if (animationType == .bounce){
cell.bouncingAnimation(forIndex: indexPath.row)
}else if (animationType == .moveIn){
cell.moveInAnimation(forIndex: indexPath.row)
}else if (animationType == .leftIn){
cell.leftInAnimation(forIndex: indexPath.row)
}else if (animationType == .rightIn){
cell.rightInAnimation(forIndex: indexPath.row)
}else if (animationType == .side){
if (indexPath.row % 2 == 0){
cell.leftInAnimation(forIndex: indexPath.row)
}else{
cell.rightInAnimation(forIndex: indexPath.row)
}
}else{
cell.fadeInAnimation(forIndex: indexPath.row)
}
}
作者
Pratik Lad, [email protected]
许可
UITableViewCellAnimation可在MIT许可证下使用。更多信息请参阅LICENSE文件。