ios - How can I insert an element on a View Controller without modifying the rest of constraints? -


i facing problem makes me waste lot of time. each time insert element on view controller (e.g uitextfield, uibutton, etc) , have set constraints rest of elements on view controller have delete constraints , add new ones because new element brokes structure of screen position of elements (it modifies constraints also).

i spend lot of time each time have change on screen of swift application because each time modify have add constraints again.

is there way in can insert element ignoring rest of elements , position new element according 1 or more of elements on screen? or constraints ignore new element until have set correctly? or similar workaround?

p.s: according comments, seems question not clear, going add additional info:

  • i trying insert new element when designing application.
  • i using main.storyboard file insert new elements.
  • i drag elements view controller.
  • i using xcode.

thanks in advance!

you can still let xcode create constraints you, works fine of time. select in menu:

editor > resolve autolayout issues > reset suggested constraints 

after doing still can change few of constraints fit needs.


in general, drop of views in controller , set constraints @ end.

as @anand k mentioned, stack views great way layout app plus it's encouraged apple.


Comments