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

Suggestion: canbecomefocused #9

Closed
ninokierulf opened this issue Mar 14, 2018 · 1 comment
Closed

Suggestion: canbecomefocused #9

ninokierulf opened this issue Mar 14, 2018 · 1 comment

Comments

@ninokierulf
Copy link

ninokierulf commented Mar 14, 2018

working with collectionView, sometimes you want the collectionViewDelegate to
decide whether to allow focus or not via
func collectionView(_ collectionView: UICollectionView, canFocusItemAt indexPath: IndexPath) -> Bool

after some time of investigation, I discovered that when a collectionviewcell overrides
canBecomeFocused, the collectionViewDelegate function
func collectionView(_ collectionView: UICollectionView, canFocusItemAt indexPath: IndexPath) -> Bool
doesn't get called.

to solve this issue, I just commented the code
in ParallaxCollectionViewCell,

//open override var canBecomeFocused : Bool {
//        return true
//}
nonameplum pushed a commit that referenced this issue Apr 25, 2019
…comeFocused : Bool` to unlock usage of `func collectionView(_ collectionView: UICollectionView, canFocusItemAt indexPath: IndexPath) -> Bool` from the `UICollectionViewDelegate`. You can still override `canBecomeFocused` in your custom `UICollectionViewCell` implementation as in the example's `CollectionViewCell` -> Addressed #9
@nonameplum
Copy link
Contributor

Addressed with 28963a5

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

No branches or pull requests

2 participants