younatics / ExpandableCell

✨ Awesome expandable, collapsible tableview cell for iOS written in Swift 5
MIT License
772 stars 124 forks source link

In expanded cells, 'SELECTED' mode 'ON' for multiple cells #56

Closed mustafiz012 closed 5 years ago

mustafiz012 commented 5 years ago

If I select a expanded cell, it's perfectly alright. But when I go for another selection, both selected cells are being highlighted. So more than one item selection makes this issue. Please let me know if it already has a solution or any way around?

pikaboo commented 5 years ago

can you post a screenshot of what you mean ?

mustafiz012 commented 5 years ago

can you post a screenshot of what you mean ?

//Removed this image

Here is the screenshot I've been troubled with :: multiple menu items got selected at a time

mustafiz012 commented 5 years ago

@pikaboo Did you get some times to check it out? I've implemented it and facing this issue. :(

pikaboo commented 5 years ago

@mustafiz012 can you share the setup code for your tableview please? and expected behaviour

mustafiz012 commented 5 years ago

@pikaboo You can check https://github.com/younatics/ExpandableCell/tree/master/ExpandableCellDemo this example. This demo shows same behavior (my issue with).

TableView behavior should be like, when you select a cell (table item) that one should be highlighted (suppose, yellow colored items here).

pikaboo commented 5 years ago

I cannot reproduce this issue, I have this in my storyboard tableview image

Please confirm you have the same and facing this issue?

Also please let me know which version of the library you are using?

mustafiz012 commented 5 years ago

@pikaboo If you please show me the single selected highlighted item??

NB: In the demo, selected item isn't keeping itself highlighted when you click on an item.

img_20181118_123309__01

mustafiz012 commented 5 years ago

image

If you uncomment these lines in demo project then you'll find the output like my first picture, otherwise selected item acts like, blinking once and disappear the highlighted color

pikaboo commented 5 years ago

is this what you were looking for ? https://imgur.com/rHDnskM

mustafiz012 commented 5 years ago

@pikaboo Yes exactly I'm looking for this behavior. Please help me out.

pikaboo commented 5 years ago

because i am not able to make new version of the pod, update your Podfile with this line: pod 'ExpandableCell', :git => 'https://github.com/younatics/ExpandableCell.git', :branch => 'master' And you would need to override your ExpandableCell's method

isSelectable()

to keep the expanding cell selected

the expanded cells themselves behave according to the selection behaviour of the tableview

Also please click alt+shift+cmd+K after you do pod update

mustafiz012 commented 5 years ago

I'll try it and give you feedback. Thanks in advance, hope it's gonna work 👍

pikaboo commented 5 years ago

I thought about it a bit, and i need to add another variable to the tableview, "displaySelection" because the current state was not the default behaviour and might ruin it for other people using the library

mustafiz012 commented 5 years ago

That's absolutely correct that you should maintain default behavior. But as it's a customized library, you guys please keep user choice (Like I choose it :) ) option. Thanks.

pikaboo commented 5 years ago

ok I updated

you need to set expandableTableView.autoRemoveSelection to false, to get the behaviour you want

pikaboo commented 5 years ago

was your problem solved? I want to close this issue

mustafiz012 commented 5 years ago

I'm just working on this. One line (expandableTableView.autoRemoveSelection = false) didn't resolve my issue but I've noticed that demo project working fine. So as soon as I figure out my issue, I'm gonna let you know. Thanks.

pikaboo commented 5 years ago

the expandable cells themselves also need to be marked as selectable, if you want them to be selectable, otherwise they'll blink and open/close their expansion

pikaboo commented 5 years ago

@younatics please update pod version