9

Perhaps "flow chart" or "process chart" isn't even the correct terminology for what I'm looking for, but it's the best analog I can come up with. Basically, I'm trying to find a library or class that allows for the dynamic creation (in code) of connected cells/UIViews within a given space. In code, you could add/delete ordered cells from the view and it will arrange accordingly. Normally, if the superview size permits (i.e. iPad), it would arrange these connected cells horizontally. If it's space constrained (iPhone), it would arrange as many cells as possible on one line horizontally, then continue the rest of the cells horizontally below ... akin to a graphical "word wrap".

Granted, I doubt there's a magical library that does all of this, but if the SO community can point me to some better terminology and/or some potential candidates to fork, I would be incredibly appreciative.

I've looked at AQGridView and it is such a vast library, I believe it's overkill with a compiled size of +700 Kb. SSCollectionView is really close, but you have to manually center cells and it doesn't yet support variable cell height/width.

To give you a better sense of what I'm imagining, here's a pic: enter image description here

Greg Combs
  • 4,252
  • 3
  • 33
  • 47
  • 4
    WWDC 2010, Session 141, Crafting Custom Views had sample code for a Tree View using CGLayers. It's a) for Mac b) not a library c) generally not exactly what you're looking for (thus not an answer), but you asked for pointers and it may be worth a look. – jscs May 02 '11 at 21:46
  • 3
    What you want to do is exactly like text layout where the spaces are yellow connector lines and the (indivisible) words are views. Looking at it that way, you should be able to apply insights going back as far as TeX. There might even be a way to make CoreText do some of the layout work for you – each box can be regarded as a custom glyph instead of a custom word, with the connect being the "space" glyph. – Jeremy W. Sherman May 12 '11 at 22:04
  • I've actually forgotten that CoreText was available in iOS now (since 3.2 I guess). This may beyond my comprehension as of yet, but I'll poke around and see what I can figure out. – Greg Combs May 13 '11 at 17:26

2 Answers2

4

Done. I had to write my own, but it works just like I wanted it to. Feel free to fork my AppendingFlowView repository at GitHub.

  • It's dynamic (add stages on demand).
  • It responds to changes in the master view by reorienting and resizing the cells as necessary with animation!
  • It handles multiple rows automatically, depending on the desired cell size and number of cells.

Screenshot

Greg Combs
  • 4,252
  • 3
  • 33
  • 47
0

I created this open-source ios-lib to easily create a graph or tree and draw it in a view.

Please feel free to make pull requests :)

https://github.com/chikuba/JENTreeView

chikuba
  • 4,229
  • 6
  • 43
  • 75