Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Adds new Expansion style #54

Merged
merged 3 commits into from Nov 2, 2018

Conversation

robertogvieira
Copy link
Contributor

  • Adds new ExpansionStyle: singlePerSection;
  • Adapts existing code to handle new style.

Notes:

  1. This PR is based on PR Expand cells in different sections #53 (where the initial idea for this new case came from);
  2. Demo (ExpandableCellDemo) wasn't updated with a new button to test this new expansion style behaviour to avoid "overcrowding" the navigation bar with buttons.
    TL;DR: it can be easily tested by simply replacing the style (ExpansionStyle.single) currently set in method ViewController.expandSingleButtonClicked(_:) with ExpansionStyle.singlePerSection.

@pikaboo
Copy link
Collaborator

pikaboo commented Oct 29, 2018

You need to
if self.expansionStyle == .single { closeAll() }
After you have gotten the index of the cell with
if let cell = self.cellForRow(at: indexPath) {
and before you do this:
if let correctIndexPath = self.indexPath(for: cell) {

because after all the cells close, the index of the cell at hand is not the index it was when it was open.
The same goes for the condition if the style is singlePerSection

@pikaboo
Copy link
Collaborator

pikaboo commented Oct 31, 2018

could you update documentation please ?

@pikaboo pikaboo merged commit 56ce7b0 into younatics:master Nov 2, 2018
@pikaboo
Copy link
Collaborator

pikaboo commented Nov 2, 2018

@younatics Can you release new pod version? I'm not able to

@younatics
Copy link
Owner

@pikaboo I will do :)

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

Successfully merging this pull request may close these issues.

None yet

3 participants