Help with XCode 6 and Storyboards (different interfaces for different devices?)

Discussion in 'iOS Programming' started by melman101, Nov 10, 2014.

  1. melman101 macrumors 68030

    Sep 3, 2009
    I used to code with XCode back on iOS 3 and 4, so I've been out of the game for a bit. I've gotten back into coding and got the app I want coded, however, I am having trouble with this storyboard interface building.

    I built the app using the Any / Any size class, and I took my UIWebView and I pinned it using Editor | Pin | and I clicked all the options (Trailing Space, Leading Space, Bottom Space, Top Space). For all my iphones / ipad this works amazingly well.

    However, i would like to add an additional uiwebview when using just an iPad since I have screen real estate. When I go to the size classes at the bottom and change it to Regular / Any, it affects my Any / Any size class, and my Pin constraints go away, and everything breaks.

    Can anyone help? Is this possible to do, to have one storyboard with different layouts for iPhone / iPad? Please help! Thanks!
  2. melman101 thread starter macrumors 68030

    Sep 3, 2009
    John Marquez on the Apple Developer Forums responded with this

    "I've seen that problem, and it seems to occur when constraints are misconfigured. Try resetting to default constraints and see if that works or if it gets you close enough to fix any special constraints your UI has.

    Save your work, then use the Constraint toolbar or Editor menu to Resolve Auto Layout Issues for "All Views"
    1. Clear constraints
    2. Add missing constraints

    Then test the different size classes.

    When constraints are configured correctly, the UI _should_ appear as expected on all devices and when selecting different size classes in IB simulator."

    And it fixed my issue.

Share This Page