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

Popular posts from this blog

html - Outlook 2010 Anchor (url/address/link) -

javascript - Why does running this loop 9 times take 100x longer than running it 8 times? -

Getting gateway time-out Rails app with Nginx + Puma running on Digital Ocean -