4 Replies
      Latest reply on Jun 6, 2019 7:46 PM by granada29
      granada29 Level 1 Level 1 (0 points)

        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?

        • Re: Xcode 11 Auto layout
          Claude31 Level 8 Level 8 (6,515 points)

          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
               }
            • Re: Xcode 11 Auto layout
              granada29 Level 1 Level 1 (0 points)

              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.

                • Re: Xcode 11 Auto layout
                  Claude31 Level 8 Level 8 (6,515 points)

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

                    • Re: Xcode 11 Auto layout
                      granada29 Level 1 Level 1 (0 points)

                      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.