robb / Cartography

A declarative Auto Layout DSL for Swift :iphone::triangular_ruler:
Other
7.34k stars 528 forks source link

Swift 3 conversion Xcode 8 GM #228

Closed raphaelcruzeiro closed 8 years ago

raphaelcruzeiro commented 8 years ago

The project builds and seems to run correctly. Still need to update Quick and Nimble and fix the tests.

orta commented 8 years ago

Rockin' - I think this will also need the travis file updating to Xcode 8 - it's currently 7.3

raphaelcruzeiro commented 8 years ago

@orta: I haven't bothered yet with the travis file as Quick and Nimble are still not Swift 3 ready. As soon as they have it working we can start migrating the tests and configuring travis to use the xcode8 image.

orta commented 8 years ago

👌 cool

raphaelcruzeiro commented 8 years ago

Also, I just realised that the ~ operator is not working as expected as of Beta 6. I really wish I could run those tests now...

raphaelcruzeiro commented 8 years ago

Quick and Nimble have been successfully migrated to Swift 3 (Xcode 8 Beta 6). I'm gonna start fixing the tests for this branch later today 🤘🏼

robb commented 8 years ago

🤘🏼

orta commented 8 years ago

👍

orta commented 8 years ago

I've just merged #203 to master, so you might have a little bit more porting to do - sorry!

raphaelcruzeiro commented 8 years ago

No worries. I'll rebase this branch and port the new code.

raphaelcruzeiro commented 8 years ago

I have converted the tests to Swift 3 and all is well except for the Priority operator which has a problem of precedence. I have tried fixing it as per SE-0077 but it seems that I got it wrong as the following test fails to build:

it("should operate on a single constraint") {
    var constraint: NSLayoutConstraint!

    constrain(view) { view in
        constraint = (view.width == 200 ~ 100)
    }

    expect(constraint.priority).to(equal(100))
}

I will take a deeper look into that later today and hopefully a commit will follow 😉

raphaelcruzeiro commented 8 years ago

@orta @robb I had no luck in getting the ~ operator working with the new precedencegroup 😞

raphaelcruzeiro commented 8 years ago

XCode 8 GM didn't break anything on this branch 😮

orta commented 8 years ago

Should also consider switching these deps to CocoaPods, every time I look at the build fails it's because of Carthage using the GitHub API

Anyway, @raphaelcruzeiro - is the ~ and rpecedencegroup a blocker?

raphaelcruzeiro commented 8 years ago

@orta I pushed a commit switching to CocoaPods. Hopefully travis will at least get to trying to build the tests. About the ~, I really have no idea how to solve that. From what I understood of SE-0077, the precedence group is correctly set for this operator. However, when trying to build the tests I get a CartographyTests/PrioritySpec.swift:22:49: Ambiguous reference to member '~'.

orta commented 8 years ago

Hrm, I haven't looked at Swift 3 but I remember this tweet perhaps you can try making the name CartographyPriorityGroup ?

raphaelcruzeiro commented 8 years ago

I can rename the precedence group to avoid possible name clashes but this will most likely not solve the operator problem.

orta commented 8 years ago

I've made a note and some PR changes in https://github.com/raphaelcruzeiro/Cartography/pull/1

orta commented 8 years ago

Submitted another PR to hopefully fix CI - https://github.com/raphaelcruzeiro/Cartography/pull/2

orta commented 8 years ago

awww, we got one green

raphaelcruzeiro commented 8 years ago

@orta 🎉

orta commented 8 years ago

env NSUnbufferedIO=YES the random things you have to do to appease the Xcode gods

OK, IMO this is good to go, will give it a look over tomorrow and give this a good to go, IMO this library has been used in production long enough that this should be the 1.0 given there there is now literally thousands of people relying on it in production

screen shot 2016-09-24 at 22 14 55