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

SwipeCollectionViewCell doesn't hide #265

Closed
jayhuo-seekers opened this issue Dec 5, 2018 · 3 comments
Closed

SwipeCollectionViewCell doesn't hide #265

jayhuo-seekers opened this issue Dec 5, 2018 · 3 comments
Labels

Comments

@jayhuo-seekers
Copy link
Contributor

In Extensions.swipe, I noticed that the computed property swipeCells implementation is different for UICollectionView and UITableView.

extension UITableView {
    var swipeCells: [SwipeTableViewCell] {
        return visibleCells.compactMap({ $0 as? SwipeTableViewCell })
    }

    ...
}

extension UICollectionView {
    var swipeCells: [SwipeCollectionViewCell] {
        return visibleCells as? [SwipeCollectionViewCell] ?? []
    }

    ...
}

Is it intentional or not?
I found if there are different kinds of UICollectionViewCells in a UICollectionView which some of them are not subclasses of SwipeCollectionViewCell, the SwipeCollectionViewCells can't hide the actions if I tap somewhere else in the collection view. Because in this case, swipeCells are always empty since visibleCells now can't be cast into [SwipeCollectionViewCell].

@kurabi
Copy link
Member

kurabi commented Dec 5, 2018

This should be changed to match what UITableView extension does. Please create a PR.

@jayhuo-seekers
Copy link
Contributor Author

@kurabi Created #266

@kurabi
Copy link
Member

kurabi commented Dec 11, 2018

This is now fixed as part of PR #266.

@kurabi kurabi closed this as completed Dec 11, 2018
@kurabi kurabi mentioned this issue Dec 13, 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

2 participants