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

didSelectItemAt not working #35

Open
git-hwa opened this issue Sep 27, 2016 · 2 comments
Open

didSelectItemAt not working #35

git-hwa opened this issue Sep 27, 2016 · 2 comments
Labels

Comments

@git-hwa
Copy link

git-hwa commented Sep 27, 2016

I have followed guidance of this library, and have faced second problem.
The first one is for connecting frontViewContainer, backViewContainer, frontConstraintY, backConstraintY, and I had no solution for that #34 #26 .
But I was able to figure it out with copy/pasting the demo cell from demo project.

Now the second problem is, I have defined didSelectItemAt method, but it's not calling all the time.

func collectionView(_ collectionView: UICollectionView, didSelectItemAt indexPath: IndexPath) {
        guard let cell = collectionView.cellForItem(at: indexPath) as? MyCollectionViewCell, currentIndex == indexPath.row else { return }

        cell.cellIsOpen(!cell.isOpened)
}

The viewcontroller is inherited from ExpandingViewController, and MyCollectionViewCell is inherited from BasePageCollectionCell.
I'm not sure why does this happening.

Any help would be appreciated.
Thanks

@Baaroon
Copy link

Baaroon commented Nov 13, 2016

I'm facing the same problem. Would someone help us?
Thanks :)

@MilezHigh
Copy link

I found the solution :]

Inside didSelectItemAt, set:

 if cell.isOpened == false {
            cell.cellIsOpen(true, animated: true)
        } else {
            pushToViewController(YourTableViewController())
        }

Make sure to set 'animated' to true when setting the cellsOpen property. I know the Demo Documentation just puts 'cell.cellIsOpen(true)' but you need it like this : cell.cellIsOpen(true, animated: true)

Hope that Helps!!

@0ber 0ber added the question label Jan 24, 2018
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
Projects
None yet
Development

No branches or pull requests

4 participants