Creating MultiLevel UITableView – Expandable & Collapsable UITableView

Using this post, I am just going to quickly describe Creating MultiLevel – Expandable & Collapsable UITableView.
Watch following screen-shots or the video to have more clarity.

Expected Output is as follows.
UITableViewCell maximize minimize expand collapse 1

UITableViewCell maximize minimize expand collapse 2

UITableViewCell maximize minimize expand collapse 3

Code for Cell of TableView

code for expanding & collapsing rows – TableView DidSelectRow Method
A Method which will help to minimize & maximize/expand-collapse rows.

Source code of sample

Source code of sample – Updated using storyboard

20 thoughts on “Creating MultiLevel UITableView – Expandable & Collapsable UITableView

    • Hi,

      Thanks for visit sugartin.info.
      For that you have to debug and implement logic or some else algorithm.

      Thanks,
      Nimit Parekh

  1. Nice work and working fine just facing one issue

    after expand table , and scroll to top lost all parent category text

    Men

    Cloth

    Shoes

     

    after expand cell and scoll to top lost all text from cell label

    can you please let mw know where to make change

    Thanks

     

     

     

  2. Thank you. It was really helpful to me.

    But for my requirement I’m facing an issue. I had added child value to level 2, all levels has different formatting. But when child is expanded and if user scroll, all the design is changed.

    Please help

      • hey nimit i liked your collapsable table view , i would like to know how can i add imageview and buttons on it that only appears when the view get expanded and also i dont want to expand the already expanded cells.

        • You need to do code inside dictionary and you can dynamically set flag and all things you require.

          It’s work as per your requirement but need to more code :-(

Leave a Reply

Your email address will not be published. Required fields are marked *



*