Not able to set constraints in XIB - Xcode 11.3.1

280 Views Asked by At

I created a project in Swift. I added view controller file and one XIB using right click on the project - > Add Files to projectname -> Empty (xib) file.

After adding the xib file, i removed the view and added View Controller. Under the View controller , i have added few button. But i am not able set the constraints.But if i add the View object instead of View Controller, i am able to set the constraints. I don't understand why the xib constraints are disabled for View controller. Attached the screen shot

enter image description here

1

There are 1 best solutions below

0
On

Layout is set to Translates Mask Into Constraints, meaning that IB is gonna generate the constraints for you automatically. Set it to Automatic and it'll work.

enter image description here