Xcode 11 Auto layout

I cannot see how to disable Auto layout in Xcode 11. I saw nothing in the release notes to say it's no longer possible.

Is it no longer possible to do this by error or design?

Replies

Effectively, the option has disappeared in XCode 11 IB.


You should be able to disable programmatically at viewDidLoad


     for constraint in self.view.constraints {
          constraint.isActive = false
     }

Thanks Claude31


I have far too many views for a code solution to be viable - there's always a chance of missing one.


I have found in Interface Builder there is a new option in the 'Size Inspector' to set Layout to either 'Automatic' or 'Translates Mask into Constraints'.


If I work through all my .xib files resetting Automatic, the Layout warnings/errors all go away.


I did try using the suggested inline fixes but that all got very muddled very quickly so I'll see how I go by disabling Automatic.

What about creating a subclass of UIViewController to just turn this off in ViewDidLoad ?

I don't have UIViewController - I'm working with macOS programs. But - ultimately I want a fix that works with Interface Builder. I don't want the noise of dozens of warnings and errors whenever I open a .xib file in Xcode.


I'll stick with the approach I mentioned above of disabling Automatic on each affected view.


Thanks anyway.

I have xibs that don't use autolayout in Mac projects too. Now I get a warning for a label "view without any constraints may clip their contents"). I resize the label at runtime and set the frame origin after changing the text (sizeToFit) so I don't need constraints. It makes more sense and is less complicated to leave everything as is.


Would be nice to be able to turn these warnings off, on a per xib basis at least.

Those type of silent removals really annoy me! There is too much legacy code around. Has anyone found a clean solution of this?