Why is the simulator using the size class in which I left the interface builder at for some specific elements...












0















I have size classes defined for iPad and iPhones. I'm using Xcode 10.1 with latest Swift 4.2 on Mojave 10.14.1. I was testing on iOS 11.0.1 and 12.1 simulators but no difference.



If I use an iPhone device in the interface builder, and then run on iPad, it will display the grid using the iPhone size class despite having an already defined size for iPad. This leads to constraint warnings in the console. The iPad size class (R, R) has the width/height defined at 100, but the console states that the active constraint is 60, which is the default. Why is it ignoring the size class?



enter image description here



If I use an iPad device in the interface builder, and then run on iPad, it will display the grid correctly using the iPad size class. No constraint warnings.



If I use an iPad device in the interface builder, and then run on an iPhone, it will display the grid using the iPad size class despite having an already defined size for iPhone. This leads to constraint warnings in the console. The iPhone size class has the default width/height of 60, and the console states that the active constraint is 60 and will break it to use the iPad size of 100. Why is it using 100 when it's not even the correct size class?



enter image description here



If I use an iPhone device in the interface builder and then run on an iPhone, it displays the grid correctly using the iPhone size class. No constraint warnings.



The worse part is that there are other elements also defined by size classes except those are not affected; only these buttons.



This is how the settings look for the affected buttons.



enter image description here



I even tried adding repetitive values for iPhones but no difference. They are ignored and it's using the iPad (R, R) class if I leave the interface builder with an iPad device.



enter image description here



I can reproduce the same invalid scenarios on my iPhone, so it seems it is not just the simulators. I am not using any programmatic code at all. I have deleted derived data, reset simulators, close/reopen Xcode, clean build folder, delete/re-add constraints, but no difference.










share|improve this question



























    0















    I have size classes defined for iPad and iPhones. I'm using Xcode 10.1 with latest Swift 4.2 on Mojave 10.14.1. I was testing on iOS 11.0.1 and 12.1 simulators but no difference.



    If I use an iPhone device in the interface builder, and then run on iPad, it will display the grid using the iPhone size class despite having an already defined size for iPad. This leads to constraint warnings in the console. The iPad size class (R, R) has the width/height defined at 100, but the console states that the active constraint is 60, which is the default. Why is it ignoring the size class?



    enter image description here



    If I use an iPad device in the interface builder, and then run on iPad, it will display the grid correctly using the iPad size class. No constraint warnings.



    If I use an iPad device in the interface builder, and then run on an iPhone, it will display the grid using the iPad size class despite having an already defined size for iPhone. This leads to constraint warnings in the console. The iPhone size class has the default width/height of 60, and the console states that the active constraint is 60 and will break it to use the iPad size of 100. Why is it using 100 when it's not even the correct size class?



    enter image description here



    If I use an iPhone device in the interface builder and then run on an iPhone, it displays the grid correctly using the iPhone size class. No constraint warnings.



    The worse part is that there are other elements also defined by size classes except those are not affected; only these buttons.



    This is how the settings look for the affected buttons.



    enter image description here



    I even tried adding repetitive values for iPhones but no difference. They are ignored and it's using the iPad (R, R) class if I leave the interface builder with an iPad device.



    enter image description here



    I can reproduce the same invalid scenarios on my iPhone, so it seems it is not just the simulators. I am not using any programmatic code at all. I have deleted derived data, reset simulators, close/reopen Xcode, clean build folder, delete/re-add constraints, but no difference.










    share|improve this question

























      0












      0








      0








      I have size classes defined for iPad and iPhones. I'm using Xcode 10.1 with latest Swift 4.2 on Mojave 10.14.1. I was testing on iOS 11.0.1 and 12.1 simulators but no difference.



      If I use an iPhone device in the interface builder, and then run on iPad, it will display the grid using the iPhone size class despite having an already defined size for iPad. This leads to constraint warnings in the console. The iPad size class (R, R) has the width/height defined at 100, but the console states that the active constraint is 60, which is the default. Why is it ignoring the size class?



      enter image description here



      If I use an iPad device in the interface builder, and then run on iPad, it will display the grid correctly using the iPad size class. No constraint warnings.



      If I use an iPad device in the interface builder, and then run on an iPhone, it will display the grid using the iPad size class despite having an already defined size for iPhone. This leads to constraint warnings in the console. The iPhone size class has the default width/height of 60, and the console states that the active constraint is 60 and will break it to use the iPad size of 100. Why is it using 100 when it's not even the correct size class?



      enter image description here



      If I use an iPhone device in the interface builder and then run on an iPhone, it displays the grid correctly using the iPhone size class. No constraint warnings.



      The worse part is that there are other elements also defined by size classes except those are not affected; only these buttons.



      This is how the settings look for the affected buttons.



      enter image description here



      I even tried adding repetitive values for iPhones but no difference. They are ignored and it's using the iPad (R, R) class if I leave the interface builder with an iPad device.



      enter image description here



      I can reproduce the same invalid scenarios on my iPhone, so it seems it is not just the simulators. I am not using any programmatic code at all. I have deleted derived data, reset simulators, close/reopen Xcode, clean build folder, delete/re-add constraints, but no difference.










      share|improve this question














      I have size classes defined for iPad and iPhones. I'm using Xcode 10.1 with latest Swift 4.2 on Mojave 10.14.1. I was testing on iOS 11.0.1 and 12.1 simulators but no difference.



      If I use an iPhone device in the interface builder, and then run on iPad, it will display the grid using the iPhone size class despite having an already defined size for iPad. This leads to constraint warnings in the console. The iPad size class (R, R) has the width/height defined at 100, but the console states that the active constraint is 60, which is the default. Why is it ignoring the size class?



      enter image description here



      If I use an iPad device in the interface builder, and then run on iPad, it will display the grid correctly using the iPad size class. No constraint warnings.



      If I use an iPad device in the interface builder, and then run on an iPhone, it will display the grid using the iPad size class despite having an already defined size for iPhone. This leads to constraint warnings in the console. The iPhone size class has the default width/height of 60, and the console states that the active constraint is 60 and will break it to use the iPad size of 100. Why is it using 100 when it's not even the correct size class?



      enter image description here



      If I use an iPhone device in the interface builder and then run on an iPhone, it displays the grid correctly using the iPhone size class. No constraint warnings.



      The worse part is that there are other elements also defined by size classes except those are not affected; only these buttons.



      This is how the settings look for the affected buttons.



      enter image description here



      I even tried adding repetitive values for iPhones but no difference. They are ignored and it's using the iPad (R, R) class if I leave the interface builder with an iPad device.



      enter image description here



      I can reproduce the same invalid scenarios on my iPhone, so it seems it is not just the simulators. I am not using any programmatic code at all. I have deleted derived data, reset simulators, close/reopen Xcode, clean build folder, delete/re-add constraints, but no difference.







      ios ios-autolayout xcode10 size-classes






      share|improve this question













      share|improve this question











      share|improve this question




      share|improve this question










      asked Jan 2 at 11:25









      Jose RamirezJose Ramirez

      1,159921




      1,159921
























          0






          active

          oldest

          votes











          Your Answer






          StackExchange.ifUsing("editor", function () {
          StackExchange.using("externalEditor", function () {
          StackExchange.using("snippets", function () {
          StackExchange.snippets.init();
          });
          });
          }, "code-snippets");

          StackExchange.ready(function() {
          var channelOptions = {
          tags: "".split(" "),
          id: "1"
          };
          initTagRenderer("".split(" "), "".split(" "), channelOptions);

          StackExchange.using("externalEditor", function() {
          // Have to fire editor after snippets, if snippets enabled
          if (StackExchange.settings.snippets.snippetsEnabled) {
          StackExchange.using("snippets", function() {
          createEditor();
          });
          }
          else {
          createEditor();
          }
          });

          function createEditor() {
          StackExchange.prepareEditor({
          heartbeatType: 'answer',
          autoActivateHeartbeat: false,
          convertImagesToLinks: true,
          noModals: true,
          showLowRepImageUploadWarning: true,
          reputationToPostImages: 10,
          bindNavPrevention: true,
          postfix: "",
          imageUploader: {
          brandingHtml: "Powered by u003ca class="icon-imgur-white" href="https://imgur.com/"u003eu003c/au003e",
          contentPolicyHtml: "User contributions licensed under u003ca href="https://creativecommons.org/licenses/by-sa/3.0/"u003ecc by-sa 3.0 with attribution requiredu003c/au003e u003ca href="https://stackoverflow.com/legal/content-policy"u003e(content policy)u003c/au003e",
          allowUrls: true
          },
          onDemand: true,
          discardSelector: ".discard-answer"
          ,immediatelyShowMarkdownHelp:true
          });


          }
          });














          draft saved

          draft discarded


















          StackExchange.ready(
          function () {
          StackExchange.openid.initPostLogin('.new-post-login', 'https%3a%2f%2fstackoverflow.com%2fquestions%2f54005477%2fwhy-is-the-simulator-using-the-size-class-in-which-i-left-the-interface-builder%23new-answer', 'question_page');
          }
          );

          Post as a guest















          Required, but never shown

























          0






          active

          oldest

          votes








          0






          active

          oldest

          votes









          active

          oldest

          votes






          active

          oldest

          votes
















          draft saved

          draft discarded




















































          Thanks for contributing an answer to Stack Overflow!


          • Please be sure to answer the question. Provide details and share your research!

          But avoid



          • Asking for help, clarification, or responding to other answers.

          • Making statements based on opinion; back them up with references or personal experience.


          To learn more, see our tips on writing great answers.




          draft saved


          draft discarded














          StackExchange.ready(
          function () {
          StackExchange.openid.initPostLogin('.new-post-login', 'https%3a%2f%2fstackoverflow.com%2fquestions%2f54005477%2fwhy-is-the-simulator-using-the-size-class-in-which-i-left-the-interface-builder%23new-answer', 'question_page');
          }
          );

          Post as a guest















          Required, but never shown





















































          Required, but never shown














          Required, but never shown












          Required, but never shown







          Required, but never shown

































          Required, but never shown














          Required, but never shown












          Required, but never shown







          Required, but never shown







          Popular posts from this blog

          generate and download xml file after input submit (php and mysql) - JPK

          Angular Downloading a file using contenturl with Basic Authentication

          Mossoró