SwiftKickMobile / TLIndexPathTools

TLIndexPathTools is a small set of classes that can greatly simplify your table and collection views.
tlindexpathtools.com
MIT License
347 stars 60 forks source link

Is there anyway to arbitrarily prevent collapsing / expanding of rows in a tree table? #47

Closed csotiriou closed 9 years ago

csotiriou commented 9 years ago

Is there anyway to arbitrarily prevent collapsing / expanding of rows? I would love to be able to have a callback or a variable of some kind, to indicate that a specific cell cannot be collapsed or expanded.

wtmoose commented 9 years ago

What component are you using? There are two extensions that do collapsing.

Tim

Sent from my phone.

On Jan 27, 2015, at 5:49 AM, Christos Sotiriou notifications@github.com wrote:

Is there anyway to arbitrarily prevent collapsing / expanding of rows? I would love to be able to have a callback or a variable of some kind, to indicate that a specific cell cannot be collapsed or expanded.

— Reply to this email directly or view it on GitHub.

wtmoose commented 9 years ago

Never mind. From our past conversations, I know you're using the tree controller. I'll add something for this...

csotiriou commented 9 years ago

Thank you very much. Yes, I am indeed using the tree controller.

For the time being, I am overriding

and I am calling "super" only for the nodes I want to have expand / collapse functionality. Although I would personally prefer a more "official" support for this feature

Thank you for the effort you put into this.

wtmoose commented 9 years ago

Yes, overriding either willSelectRowAtIndexPath or didSelectRowAtIndexPath is the way to go.

In addition, I added a shouldChangeNode method to TLTreeTableViewControllerDelegate. Take a look at version 0.3.9.

csotiriou commented 9 years ago

Excellent. It is exactly what I was looking for. Thank you.