You can achieve this easily using AutoLayout constraints.
Suppose you have three views like this:
+-----+
| A |
+-----+
+-----+
| B |
+-----+
+-----+
| C |
+-----+
and you want to make view B disappear in some cases.
Set up constraints as follows (these are just example values):
B top space to A: 4
C top space to B: 4
B height: 20
Then create an NSLayoutConstraint outlet in your code for B's height. Do this by dragging and dropping the constraint in IB.
@property (weak, nonatomic) IBOutlet NSLayoutConstraint *bHeight;
Finally, to make the view disappear, just do the following:
self.bHeight = 0;
Note that if you are doing this for a tableview cell, you may have cases where you want B to appear in some cells, but not in others.
In this case, you will have to reset the height to its "normal" value for those cells where you want it to be visible.
self.bHeight = 24;