For example, I have a parent view that contains 3 subviews. I am using Layout Anchor programatically and try to achieve following layout
|--subview 1--|--subview 2--|--subview 3--|
Each of the three subviews has equal width. In other words,
subView1.width = subView2.width = subView3.width subView1.width+subView2.width+subView3.width = parentView.width
I know I can possibly to use multiplier to set up the width for subView 1 & subView 2 as:
subView1.widthAnchor.constraintEqualToAnchor(contentView.widthAnchor, multiplier: 1/3).active = true
subView2.widthAnchor.constraintEqualToAnchor(contentView.widthAnchor, multiplier: 1/3).active = true
and subView3 can have leading anchor to be aligned with subView2's trailing anchor.
However, I saw somewhere that Interface Builder can actually assign these three widths to be equal directly (without using constant or multiplier). Is it possible to do the same with Layout Anchor programatically? And how? Thanks.