ios - How to compare and change value of constrain programatically? -
i have given constrains uiimageview xib. code can constrains of image code imageview.constraints
. want change trailing , leading, top , bottom constrains constant values. have loop through , code below:
for constrain in imageview.constraints { if constrain.firstattribute == nslayoutattribute.trailing { constrain.constant = hpadding } if constrain.firstattribute == nslayoutattribute.leading { constrain.constant = hpadding } if constrain.firstattribute == nslayoutattribute.top { constrain.constant = vpadding } if constrain.firstattribute == nslayoutattribute.bottom { constrain.constant = vpadding } }
but non of conditions excited. please me solve issue. missing?
Comments
Post a Comment