-1

I'm trying to make constraints via Snapkit in a table view cell but my problem is I need to find out which element has max y position (The lowest one).

I have an UIImageView and next to image view UILabel elements. The label text is dynamic and could be very long or very short. Below these 2 elements, I have another one that should be aligned based on the label height, either taking image view or label.

My question is how to find which element (UIIMageView, UILabel) has a bigger Y position.

To be more clear I attached a draw with simple two cases.enter image description here

mihatel
  • 846
  • 14
  • 34

1 Answers1

1

Set a greaterThanOrEqualTo constraint on both elements.

In "plain language":

  • AnotherElement.top >= ImageView.Bottom (with constant of 12, or however much space you want)
  • AnotherElement.top >= Label.Bottom (with constant of 12, or however much space you want)
DonMag
  • 69,424
  • 5
  • 50
  • 86