Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We鈥檒l occasionally send you account related emails.

Already on GitHub? Sign in to your account

Migrated to Swift 3. #2

Closed
wants to merge 10 commits into from
Closed

Migrated to Swift 3. #2

wants to merge 10 commits into from

Conversation

basememara
Copy link

I migrated the source code and unit tests. Only thing is I had to create a type alias because the unit tests were getting confused with Foundation.Thread, so I called the alias:

typealias SwiftyThread = Thread

Thank you for this very useful project. GCD is great, but not for thread-unsafe resources like Realm or Couchbase. This library saved me and so pleasant to use! I hope this project gets more stars 馃憤

@duemunk
Copy link
Owner

duemunk commented Dec 7, 2016

Awesome!

  1. Is the typealias necessary when the Foundation one is accessed through Foundation.Thread?
  2. Could you update the .travis.yml to use xcode8 instead?

@basememara
Copy link
Author

Good thought, but it doesn't compile when using Foundation.Thread. The problem only happens in the unit tests because the Thread from foundation is used in the same file, but removing it completely from the file doesn't require the typealias anymore (since it can infer it easily I believe).

I tried adding the typealias as private hoping that testable import would pick it up without exposing it, but no luck.

Might be a good idea to have the typealias anyways in case some runs into the same conflict, or using Foundation.Thread for something else in the same file?

I updated the travis-ci for xcode 8.1, but the macOS version ran into a build problem. Tried to research why but couldn't find the answer... something about cosigning or --deep?

@basememara
Copy link
Author

I was able to sneak around the name conflict in the unit test by doing this:

    #if os(iOS)
    fileprivate func threadForPlatform() -> ThreadiOS.Thread { return ThreadiOS.Thread() }
    #elseif os(tvOS)
    fileprivate func threadForPlatform() -> ThreadtvOS.Thread { return ThreadtvOS.Thread() }
    #elseif os(OSX)
    fileprivate func threadForPlatform() -> ThreadOSX.Thread { return ThreadOSX.Thread() }
    #endif

   //let thread = threadForPlatform()

I'm still having trouble with the travis build, although I did make progress. Turns out xctool doesn't support Xcode 8, so it has to be configured to use xcodebuild. I can't get the settings right, so I tried looking at the travis configs for Alamofire, SwiftyUserDefaults, etc but no luck 馃槥

@basememara basememara closed this by deleting the head repository Apr 14, 2023
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

Successfully merging this pull request may close these issues.

None yet

2 participants