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

java - WARN : org.springframework.web.servlet.PageNotFound - No mapping found for HTTP request with URI [/board/] in DispatcherServlet with name 'appServlet' -

android - How to create dynamically Fragment pager adapter -

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