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

isSelected not accessible nor possible to be overriden #923

Closed
josecostamartins opened this issue Oct 18, 2018 · 10 comments
Closed

isSelected not accessible nor possible to be overriden #923

josecostamartins opened this issue Oct 18, 2018 · 10 comments

Comments

@josecostamartins
Copy link

IMPORTANT - BEFORE CREATING YOUR ISSUE PLEASE READ THE FOLLOWING:

  1. PLEASE STATE THE VERSION NUMBER you are using.
    7.1.6
  2. Are you using the latest version of JTAppleCalendar? Latest version is currently 7.1.6
    yes
  3. PROVIDE ENOUGH INFORMATION SO I CAN RECREATE THE PROBLEM.
    On version 7.1.6 the isSelected property of UICollectionViewCell is being made unavailable: c632d01#diff-e3c6534332137dabc366cc453e6665e0

This breaks my custom implementation since I have a custom state when the user selects a cell. What are the reasons to disallow overriding of a property that's not even specific of JTAppleCell?
This clearly breaks expected behavior from parent classes

Maybe there's another way to do this changes without prohibiting the use of isSelected...

@patchthecode
Copy link
Owner

I made it unavailable in favor of cellState.isSelected.
because of this -> #553
Scroll down to the section Problem # 2

Many people are using .isSelected and are getting the wrong value sometimes because of outofSync.
Can you use cellState.isSelected ?
If you cannot use it, then i will revert that code so that you can use it. I will then have to come up with a better solution.

@josecostamartins
Copy link
Author

josecostamartins commented Oct 19, 2018

I've been thinking about the issue and could not find the time to investigate it further.
Checking my code again, I might be able to overcome this problem without asking you to revert the code.

Just need some time to investigate things further, next week I'll come up with something and I'll update this issue

Thank you for your time

@JettF
Copy link

JettF commented Nov 7, 2018

Just ran headlong into this. I am using isSelected on the cell itself to determine if I should display a custom highlight view. The cell does not have access to the cellState, so I am blocked currently. I will spend some time thinking about a solution for this.

@josecostamartins
Copy link
Author

josecostamartins commented Nov 7, 2018

@JettF , I just refactored the name of the isSelected property inside the cell to isUserSelect or something like that and it worked for me

EDIT: Being my case that I update the cell property by hand and do not depend on isSelected from CollectionViewCell

@3vangelos
Copy link

@JettF run into the same issue. Did you figure out any solution?

@patchthecode
Copy link
Owner

patchthecode commented Nov 8, 2018

Ok, since many people still want this, i will revert my original code, and try to implement another solution

@3vangelos
Copy link

In my case going for cellState property was totally fine. In the end these weren't to big adjustments. Thanks @patchthecode

@agordeev
Copy link

I use isSelected.didSet to update cell's colors. Not sure that would be achievable using cellState.isSelected.

For now I had to delete unavailable block manually

@patchthecode
Copy link
Owner

@agordeev
I will revert the change, and put a warning there instead.

If you are using it for the didSet property, this is valid.
but, if you are using it as cell.isSelected == true then you may run into issues.

I will put a warning there. Because your concern is valid.

@patchthecode
Copy link
Owner

patchthecode commented Mar 27, 2019

@agordeev can you open a new issue for this?
On a closed issue like this i may forget. I am unable to do that right now.

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

5 participants