Usually to keep things fitting in their container you can keep track of your scale numbers. (two objects with X size 0.5 will fit 0.5+0.5=1 and so on. There might be some situations though where you don’t directly now the scale of an object on one axis because it might be constrained. (UIConstraint or Relative settings for example) If you had an object along the constrained axis, you could definitely write some code to calculate it, but that gets in the way of visual design building and this seems like a pretty fundamental object in functionality.
Here is an example:
I was working on this and my image in the middle needs to be constrained to keep its square shape then I want the length of the next two elements to “fill” horizontally to the end of the container its in. I’m using UILayouts as well to keep them neatly padded and organized.