I am trying to use the new Auto Layout in Lion because it seems quite nice. But I can not find good information about how to do things. For example:
I have two labels:>
Solved this issue programmatically. I have a few buttons in a row, and I may decide to hide one at any time.
Used Cartography to replace them each time hidden
changes in any of them.
let buttons = self.buttons!.filter { button in
return !button.hidden
}
constrain(buttons, replace: self.constraintGroup) { buttons in
let superview = buttons.first!.superview!
buttons.first!.left == superview.left
for var i = 1; i < buttons.count; i++ {
buttons[i].left == buttons[i-1].right + 10
}
buttons.last!.right == superview.right
}