Skip to content
This repository was archived by the owner on Nov 15, 2020. It is now read-only.
This repository was archived by the owner on Nov 15, 2020. It is now read-only.

TableReloadAnimations is now conform to the new TableReloadAnimationProtocol protocol #19

@malcommac

Description

@malcommac

Allows full customization of the animations for row/sections in UITableView by creating a general protocol which replaces the following methods of the TableReloadAnimations struct:

public var rowDeletionAnimation: UITableView.RowAnimation = .automatic
public var rowInsertionAnimation: UITableView.RowAnimation = .automatic
public var rowReloadAnimation: UITableView.RowAnimation = .automatic
	
public var sectionDeletionAnimation: UITableView.RowAnimation = .automatic
public var sectionInsertionAnimation: UITableView.RowAnimation = .automatic
public var sectionReloadAnimation: UITableView.RowAnimation = .automatic

TableReloadAnimations now is a default implementation of the TableReloadAnimationProtocol which defines two methods to animate row and section of a table for different actions:

public protocol TableReloadAnimationProtocol {
	func animationForRow(action: TableAnimationAction) -> UITableView.RowAnimation
	func animationForSection(action: TableAnimationAction) -> UITableView.RowAnimation
}

TableAnimationAction is just an enum which defines all the actions you can perform:

public enum TableAnimationAction {
	case delete
	case insert
	case reload
}

You can still use the TableReloadAnimations.default() struct to perform automatic refresh.

Metadata

Metadata

Assignees

Labels

enhancementNew feature or request

Projects

No projects

Relationships

None yet

Development

No branches or pull requests

Issue actions