0

I am trying to achieve tree like structure as shown in below image on my iPhone App

Package 1 => Packg 1.1 Package 1.1.1 Package 1.1.2 Packg 1.2

Its like user received Package having 3 bottles send by vendors. Either vendor has package each bottle as sub package or directly all three bottles within single package. Individual bottle is termed as Item and Package as Packages.

There is Package0010 as main package and depending on bottle packaging we either subdivide as three sub package having 1 item each. or two sub package(two item) and one separate item so total 3 Item or bottles.

How I can achieve above structure. Note I am using UILable, UITexfield, UITexfield with tags. I can not use UITableview ...

just idea if anyone came across such problem...

4 Answers 4

2

I use RATreeView component for similar tasks. It is used like UITableView with datasource and delegate protocols, and it is highly customisable.

https://github.com/Augustyniak/RATreeView

3
  • hello, thank you for the reply. i downloaded RATreeView , tried to run sample basic example , added RATree class but it not working .... cocoapod i am totally new to this Nov 16, 2016 at 11:09
  • Just copy files from it into your project - RATreeView.h and RATreeView.m No need to use pod. Nov 16, 2016 at 16:14
  • Thank you so much, will customise for my need... :-) Nov 17, 2016 at 10:13
1

There are many samples available on cocoa controls. You can refer following link ;

Cocoa Controls

You can use any of following example;

1) Example 1

2) Example 2

3) Example 3

All these use UITableView's delegate and datasource methods, so you can easily integrate and modify it accordingly your requirements.

Hope this will help you.

1
  • hello, thank you for the reply. i downloaded RATreeView , tried to run sample basic example , added RATree class but it not working .... cocoapod i am totally new to this Nov 16, 2016 at 11:09
0

I designed a simple treeView in swift.

You can see the code in my GitHub

0

I use SwiftListTreeDataSource to visualise hierarchical data structures (trees) in lists-like way. It's UI agnostic, just like view-model, so you can use it with UITableView/UICollectionView/NSTableView or even SwiftUI with search feature. enter image description here

Your Answer

By clicking “Post Your Answer”, you agree to our terms of service and acknowledge that you have read and understand our privacy policy and code of conduct.

Not the answer you're looking for? Browse other questions tagged or ask your own question.