spruce-ios icon indicating copy to clipboard operation
spruce-ios copied to clipboard

Add option to include section headers in animations

Open MaxHaertwig opened this issue 8 years ago • 4 comments

This code adds two static properties to Spruce, providing the option to include section headers of UITableView or UICollectionView in Spruce animations.

Usage (anywhere in app): Spruce.includeTableViewSectionHeaders = true Spruce.includeCollectionViewSectionHeaders = true // The default value is false for both properties (current behavior)

MaxHaertwig avatar Oct 04 '17 22:10 MaxHaertwig

@Vyax First thank you very much for the contribution! Is there a reason why you chose to make the variables static?

My thinking is that maybe we should add such functionality to the animate and prepare functions so that on certain pages you can include the headers while on others you won't.

jacksontaylor13 avatar Jan 09 '18 03:01 jacksontaylor13

The animate and prepare functions already take a lot of parameters, so I though having static variables would be a good solution. They can also be set in viewDidLoad of each individual screen.

Do you want me to add them as parameters to animate?

MaxHaertwig avatar Jan 27 '18 10:01 MaxHaertwig

@Vyax I completely agree! They definitely do already take too many parameters. I just added a PR that will swap parameters over for AnimationOption values. This way we can keep adding parameters without worrying about the method schema length. We'll see if the maintainers like it and then maybe we can transition your PR to use the options layout instead.

jacksontaylor13 avatar Jan 29 '18 19:01 jacksontaylor13

I would love to see a PR adding functionality like this merged in, though I agree with @jacksontaylor13 that it would be best to do so as a per-animation configuration rather than using static variables at the top level.

zackdotcomputer avatar Jul 15 '19 16:07 zackdotcomputer