动画重新加载tableview

动画重新加载tableview

Swift 其它杂项

访问GitHub主页

共87Star

详细介绍

Reload tableview with animation

right to left bottom to top left to right top to bottom
with header and footer .rotation3D(type: .ironMan) .rotation3D(type: .thor) .rotation3D(type: .spiderMan)
.rotation3D(type: .captainMarvel) .rotation3D(type: .doctorStrange) .rotation3D(type: .daredevil) .rotation3D(type: .deadpool)

Requirements

  • iOS 9.0+

Installation

CocoaPods

CocoaPods is a dependency manager for Cocoa projects. You can install it with the following command:

$ gem install cocoapods

To integrate TableViewReloadAnimation into your Xcode project using CocoaPods, specify it in your Podfile:

source 'https://github.com/CocoaPods/Specs.git'
platform :ios, '9.0'
use_frameworks!

target '<Your Target Name>' do
    pod 'TableViewReloadAnimation', '~> 0.0.5'
end

Then, run the following command:

$ pod install

Usage

import TableViewReloadAnimation

in viewDidAppear

// left animation
tableView.reloadData(
    with: .simple(duration: 0.45, direction: .left(useCellsFrame: true),
    constantDelay: 0))

// right with spring
tableView.reloadData(
    with: .spring(duration: 0.45, damping: 0.65, velocity: 1, direction: .right(useCellsFrame: false),
    constantDelay: 0))

// rotation with spring
tableView.reloadData(
    with: .spring(duration: 0.45, damping: 0.65, velocity: 1, direction: .rotation(angle: Double.pi / 2),
    constantDelay: 0))

// rotation 3d
tableView.reloadData(
    with: .simple(duration: 0.75, direction: .rotation3D(type: .ironMan),
    constantDelay: 0))