KiranJasvanee / InfinityExpandableTableTree

Provides a tableview cells expansion (expanding cell area - subcells'), you can expand cells up to level ∞-1. Use Dynamic JSON Tree structure to initialise, or use static initialisers - Indexing/Swifty Closures.
MIT License
167 stars 45 forks source link

Limit of "+" and "-" up to three levels only #1

Closed av089 closed 7 years ago

av089 commented 7 years ago

simulator screen shot 30-may-2017 6 35 23 pm

It does not show "+" or "-" after three level & it is too much complicated to match with your format.

Please do some improvements.

Looks like statically made for 3 levels only.

Thank you,

KiranJasvanee commented 7 years ago

Hi av089,

simulator screen shot 01-jun-2017 12 02 27

I got your point and as I assured you it will work, and surely you will understand my point of flexibility for using multiple images at any internal level. I think it's a confusion of understanding an implementation procedure.

I've a given a full command of a 'UITableViewCellor 'Custom Cells towards developers, Because you know your Cells better and how you want to design them.

Suppose you want some other images in internal levels or at any level rather than my default "+" and "-".
Suppose you want + - at level 1 and → ↓ at level 2.
and Suppose you want + - image not at the end of right side, you want at the left or somewhere else in your Cell's design layout

A example you checked, I've kept only a UITableViewCell with node.index text inside it for internal levels after 3rd. I haven't implemented + - in UITableViewCell based on node.state.

If you want to implement "+" and "-" at internal levels more than 3. You can easily do this with node.state, if it's open you can keep "+" or any other image too suppose "→", If it's close you can keep "-" or any other image too suppose "↓". And you can add any image of Open and Close for any level!

You just have to add a UIButton in UITableViewCell or 'Custom Cell' based on your layout requirement and assign an image in button states.

if node.state == .open {
                cellChild?.buttonState.setImage(UIImage(named: "arrow_right"), for: .normal)
            }else if node.state == .close {
                cellChild?.buttonState.setImage(UIImage(named: "arrow_down"), for: .normal)
            }else{
                cellChild?.buttonState.setImage(nil, for: .normal)
            }

If i would have placed + - static images with static place, I would have got an issue of not providing flexibility and full command of Cell of yours. That's why I've given node.state to handle to handle flexibility.

KiranJasvanee commented 7 years ago

Hi av089,

I hope you understand my point and flexibility I wanted to provide to developers for their custom cells.

Thanks. Always happy to help you. :) I'm open for suggestions of any innovative idea in this existing repository OR new repository.