Search code examples
swiftswift2xcode7-beta4

Swift 1.2 -> Swift 2 Conversion time


Has anyone converted an app from 1.2 to Swift 2? My app is small - about 1k LOC, and its been converting for >2 hours now. I'm stuck on the following screen:

screen]([![enter image description here

How long should I expect this to take? Thanks...


Solution

  • Swift compiler has an issue with arrays. I have commented out all the elements of the array (like 10x UIColor), left only one element and conversion went smoothly.

    Here's how you can debug the issue in your project:

    1. Got to the Report navigator (CMD + 8)
    2. Build your app, select the latest build and watch log (select All Messages filter)
    3. The problematic file will be stuck on the compile status.
    4. Navigate to that file and figure out what can hang the compiler (probably arrays/dictionaries).

    Why build not convert? Because it's verbose.