I have a view like this
_______________________________
| | |
| Label 0 |
| ^ |
| Label 1 |
| ^ |
| Label 2 |
| ^ |
| Label N |
|_______________________________|
^
stands for a constraint that links the top of Label X+1
with the bottom of Label X
. Label 0
is constrained to the superview's top with a fixed constant.
What I'm trying to achieve is: if some Label X
is empty, then Label X+1
has to take its place.
_______________________________
| | |
| Label 0 (empty) |
| ^ |
| Label 1 |
| ^ |
| Label 2 |
| ^ |
| Label N |
|_______________________________|
|
| The new layout
\ /
_______________________________
| | |
| Label 1 | (here it is also Label 0 but is empty)
| ^ |
| Label 2 |
| ^ |
| Label N |
|_______________________________|
Is this possible with auto layout or do I have to programatically check emptiness to update the constraints manually?
Disclaimer: If this questions sounds very basic excuse me, please, I'm migrating from springs and struts and it is a quite criptic for now.