I\'m trying to make a bunch of buttons behave somewhat like float:left in CSS. So whenever the view changes size, on orientation change for example, the buttons should adjust so
I have implemented a layout system to do things like this. There is a demo project on how to use it checked into that repository. I'd be happy to answer any questions about it. This is much more lightweight than AQGridView, so if you don't need the extra functionality he is providing, I would recommend an approach similar to mine.
If you had to implement this manually (by overriding layoutSubviews), I think the algorithm would be something like this:
you might want to check out AQGridView, which is basically a re-implementation of Cocoa's NSCollectionView: https://github.com/AlanQuatermain/AQGridView
Otherwise, you might need to override layoutSubviews in your parentView and then rearrange the subviews (buttons) accordingly when the dimensions of the parentView change.
Cheers,
Johannes