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
Layout is set to
Translates Mask Into Constraints
, meaning that IB is gonna generate the constraints for you automatically. Set it toAutomatic
and it'll work.