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

TableReloadAnimations is now conform to the new TableReloadAnimationProtocol protocol #19

Closed
malcommac opened this issue Oct 13, 2018 · 0 comments
Assignees
Labels
enhancement New feature or request
Milestone

Comments

@malcommac
Copy link
Owner

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.

@malcommac malcommac self-assigned this Oct 13, 2018
@malcommac malcommac added this to the 0.6.1 milestone Oct 13, 2018
@malcommac malcommac added the enhancement New feature or request label Oct 13, 2018
malcommac added a commit that referenced this issue Oct 13, 2018
…crete TableReloadAnimations struct implementation
Sign up for free to subscribe to this conversation on GitHub. Already have an account? Sign in.
Labels
enhancement New feature or request
Projects
None yet
Development

No branches or pull requests

1 participant