Search code examples
xcodestoryboardxcode5xcode6xcode-storyboard

Backward compatibility of Storyboards from Xcode 6 to Xcode 5 + Support iOS 7 in Xcode 6


After making some changes in my project under Xcode 6, I can't open storyboard file (and build project) from Xcode 5.

Since there is no way to Distribute apps to AppStore from Xcode 6, while it under beta - I have to build application under Xcode 5.

Is any way to make storyboard backward compatibile with Xcode 5? I found in the header of storyboard file this string:

<capability name="Constraints with attributes relative to the layout margin" minToolsVersion="6.0"/>

I suppose, that it's need to delete or edit some new keys, that new Xcode 6 uses, but can't detect which one.

(Revert commit is VERY unlikely, because there is a LOT of changes.)

enter image description here


UPD:

There is another problem, that appears in Xcode 6 - it adds baseline constraints, that not available in iOS 7, and it cause crashes on it. (Xcode even not always highlight this warnings!) - to fix it refer to my answer, how to remove baseline attributes.


Solution

  • Hooray! I fix it! Hope It will be useful for others:

    I use regex to find all dummy strings (regex version that support Sublime 2)

    1. Open your stroyboard file in favorite text editor.
    2. find all using regex (\w)Margin"
    3. Replace all occurrences by pattern: \1"
    4. remove <capability name="Constraints with attributes relative to the layout margin" minToolsVersion="6.0"/> from beggining of file.
    5. Find and remove from storyboard file all strings by pattern: .*"baseline".*\n
    6. To fix misaligns: Open file in Xcode 5 - and Update constraints for all views.
    7. That's it! Profit!

    UPD: I found that "baseline" constraints causes crashes also, but Xcode doesn't show any warnings about these constrains!

    To fix it - remove from storyboard file all strings by pattern: .*"baseline".*\n