4 ms·
Is there already NSURLSession (or Swift's equivalent) for Linux?
by euyyn 9y ago
Is there already NSURLSession (or Swift's equivalent) for Linux?
- veidr 9y agoYes, and there has been for a while now. However, (as you might already know, since you chose the NSURLSession example), it's not 100% feature-complete when compared to the macOS or iOS version. Here's one example of where you have to do (or at least, I had to do on 2017-07-12) #if !os(Linux) to account for platform differences: https://github.com/soracom/soracom-sdk-swift/blob/master/Sources/Request.swift#L291 https://github.com/soracom/soracom-sdk-swift/blob/master/Sou... You will encounter that kind of thing from time to time if you use Swift and Foundation on Linux. Still, the Foundation library is highly usable on Linux, and is vastly ahead of where I expected they would be by now when they announced it. But there are still some things that are not implemented. They actually do have a good status page about this topic specifically: https://github.com/apple/swift-corelibs-foundation/blob/master/Docs/Status.md https://github.com/apple/swift-corelibs-foundation/blob/mast...