# SwiftNIO 2

**URL:** <https://forums.swift.org/t/swiftnio-2/22136>\
**Category:** SwiftNIO\
**Created:** [March 26, 2019, 9:52am UTC](https://forums.swift.org/t/swiftnio-2/22136 "2019-03-26T09:52:59Z")\
**Posts on this page:** 15\
**Page:** 1

<div class="post-metadata">

**Author:** ![johannesweiss](https://sea2.discourse-cdn.com/swift/user_avatar/forums.swift.org/johannesweiss/32/38183_2.png) [@johannesweiss](https://forums.swift.org/u/johannesweiss)\
**Post date:** [March 26, 2019, 9:52am UTC](https://forums.swift.org/t/swiftnio-2/22136/1 "2019-03-26T09:52:59Z")

</div>

# Announcing SwiftNIO 2

Now that Swift 5 has been [released](https://swift.org/download), we are very excited to also release SwiftNIO [`2.0.0`](https://github.com/apple/swift-nio/tree/2.0.0) for the brand new Swift 5 🚀.

First of all, a big thank you to the SwiftNIO community 💜. The SwiftNIO project is now just over one year old and your contributions have been amazing. We are so happy to see the awesome things you have built using SwiftNIO in its first year and can't wait for what's next. A special shout-out also to all those living on the NIO 2 branches as we were developing them, it was a huge help to have the code run in actual projects right after it was written.

The main theme of the SwiftNIO 2 release is a refinement of our APIs and taking advantage of the new features in Swift 5 such as the new [UTF-8 String](https://swift.org/blog/utf8-string/) ✨. In addition to these refinements in the core of SwiftNIO, there are two major changes that are we are most excited about:

1. [`swift-nio-ssl`](https://github.com/apple/swift-nio-ssl) now provides TLS (SSL) support without relying on your system's OpenSSL version. That allows much improved compatibility and makes SwiftNIO ready for future protocols that cannot be implemented without very up to date TLS libraries that Linux distributions often don't provide. That is achieved by vendoring BoringSSL inside the swift-nio-ssl SwiftPM package.
2. [`swift-nio-http2`](https://github.com/apple/swift-nio-http2) is now a pure-Swift implementation of the HTTP/2 protocol 🚀. That means you can now use HTTP/2 with SwiftNIO without having the nghttp2 library installed on your system.

Besides being super cool to have a pure-Swift HTTP/2 implementation this also means that using SwiftNIO for your package is easier than ever as with Open/LibreSSL and nghttp2 we dropped two significant system dependencies.

To get started, check out the [README](https://github.com/apple/swift-nio/blob/master/README.md). If you want to migrate your SwiftNIO 1 application or library, do check out the [migration guide](https://github.com/apple/swift-nio/blob/master/docs/migration-guide-NIO1-to-NIO2.md) we prepared for you. If you don't want to migrate right now, or you can't because you want to continue supporting Swift 4, don't worry: SwiftNIO1 does work with Swift 5 just fine and there's no action required today or in the near future.

If you want to start using SwiftNIO 2 right now without further ado, please find below the correct SwiftPM dependencies for all the repositories in the SwiftNIO 2 family (yes, some of them have major version 1).

```swift
// 🚀
.package(url: "https://github.com/apple/swift-nio.git", from: "2.0.0"),

// 🔐
.package(url: "https://github.com/apple/swift-nio-ssl.git", from: "2.0.0"),

// ⛑
.package(url: "https://github.com/apple/swift-nio-extras.git", from: "1.0.0"),

// 2️⃣
.package(url: "https://github.com/apple/swift-nio-http2.git", from: "1.0.0"),

// , for `platforms: [.macOS(.v10_14), .iOS(.v12), .tvOS(.v12),]`
.package(url: "https://github.com/apple/swift-nio-transport-services.git", from: "1.0.0"),

```

Please feel free to reach out if you have any questions!

Thank you, the SwiftNIO team.

---

<div class="post-metadata">

**Author:** ![johannesweiss](https://sea2.discourse-cdn.com/swift/user_avatar/forums.swift.org/johannesweiss/32/38183_2.png) [@johannesweiss](https://forums.swift.org/u/johannesweiss)\
**Post date:** [March 26, 2019, 10:09am UTC](https://forums.swift.org/t/swiftnio-2/22136/2 "2019-03-26T10:09:57Z")

</div>

![02%20am](https://global.discourse-cdn.com/swift/original/2X/5/54735abb050eb6da84b81ac561bd358389ca8c91.png)

---

<div class="post-metadata">

**Author:** ![IanPartridge](https://sea2.discourse-cdn.com/swift/user_avatar/forums.swift.org/ianpartridge/32/434_2.png) [@IanPartridge](https://forums.swift.org/u/IanPartridge)\
**Post date:** [March 26, 2019, 10:29am UTC](https://forums.swift.org/t/swiftnio-2/22136/3 "2019-03-26T10:29:38Z")

</div>

Congratulations to the team - great news 😀

---

<div class="post-metadata">

**Author:** ![lukasa](https://sea2.discourse-cdn.com/swift/user_avatar/forums.swift.org/lukasa/32/1232_2.png) [@lukasa](https://forums.swift.org/u/lukasa)\
**Post date:** [March 26, 2019, 10:53am UTC](https://forums.swift.org/t/swiftnio-2/22136/5 "2019-03-26T10:53:42Z")

</div>

> [@Helge\_Hess1](#):
>
> Good job, love the http2 part.

It's my favourite part too, I'm very excited about it, not least because it puts the SwiftNIO community in charge of its own destiny. It is much easier for contributors to tweak and change things because the implementation is in a language they use every day. Over the next several months I expect to see a bunch of features land, but also an enormous amount of performance improvement as we invest in infrastructure to measure performance and start throwing brainpower at any perf issues we may have today.

Speaking of which, the more the community can hammer this stuff out, the faster it'll improve. We fixed a number of subtle bugs in the swift-nio-ssl stuff before 2.0 thanks to @tanner0101 picking it up early, as well as a number of HTTP/2 bugs thanks to people in the GRPC community.

With that in mind, @Helge_Hess1: if I were a betting man, I'd say that I bet that swift-nio-http2 doesn't work properly on Raspberry Pi. I wonder if we can find someone to help out with that work? 😉

---

<div class="post-metadata">

**Author:** ![freak4pc](https://sea2.discourse-cdn.com/swift/user_avatar/forums.swift.org/freak4pc/32/2756_2.png) [@freak4pc](https://forums.swift.org/u/freak4pc)\
**Post date:** [March 26, 2019, 11:10am UTC](https://forums.swift.org/t/swiftnio-2/22136/7 "2019-03-26T11:10:09Z")

</div>

Amazing work! Congratulations on the release :)

---

<div class="post-metadata">

**Author:** ![inahuelzapata](https://sea2.discourse-cdn.com/swift/user_avatar/forums.swift.org/inahuelzapata/32/6512_2.png) [@inahuelzapata](https://forums.swift.org/u/inahuelzapata)\
**Post date:** [March 26, 2019, 11:24am UTC](https://forums.swift.org/t/swiftnio-2/22136/8 "2019-03-26T11:24:43Z")

</div>

Awesome news! Congratulations 👏👏

---

<div class="post-metadata">

**Author:** ![kirilltitov](https://sea2.discourse-cdn.com/swift/user_avatar/forums.swift.org/kirilltitov/32/4182_2.png) [@kirilltitov](https://forums.swift.org/u/kirilltitov)\
**Post date:** [March 26, 2019, 11:28am UTC](https://forums.swift.org/t/swiftnio-2/22136/9 "2019-03-26T11:28:21Z")

</div>

Gratz! Awesome news! Already started migrating my projects :)

---

<div class="post-metadata">

**Author:** ![IanPartridge](https://sea2.discourse-cdn.com/swift/user_avatar/forums.swift.org/ianpartridge/32/434_2.png) [@IanPartridge](https://forums.swift.org/u/IanPartridge)\
**Post date:** [March 26, 2019, 11:37am UTC](https://forums.swift.org/t/swiftnio-2/22136/10 "2019-03-26T11:37:35Z")

</div>

I'm afraid Raspi won't be covered by the Swift 5 images, at least in the short term. When there are Raspi binaries on [Swift.org - Download Swift](http://swift.org/download) we can revisit that.

---

<div class="post-metadata">

**Author:** ![dimpiax](https://sea2.discourse-cdn.com/swift/user_avatar/forums.swift.org/dimpiax/32/14339_2.png) [@dimpiax](https://forums.swift.org/u/dimpiax)\
**Post date:** [March 26, 2019, 12:04pm UTC](https://forums.swift.org/t/swiftnio-2/22136/11 "2019-03-26T12:04:49Z")

</div>

Excellent! 💪

---

<div class="post-metadata">

**Author:** ![kirilltitov](https://sea2.discourse-cdn.com/swift/user_avatar/forums.swift.org/kirilltitov/32/4182_2.png) [@kirilltitov](https://forums.swift.org/u/kirilltitov)\
**Post date:** [March 26, 2019, 12:37pm UTC](https://forums.swift.org/t/swiftnio-2/22136/12 "2019-03-26T12:37:55Z")

</div>

FDBSwift can't celebrate more :D

 ![06](https://global.discourse-cdn.com/swift/original/2X/6/61046e34a3d477083688ca9fcaae606ac5ffae22.png)

---

<div class="post-metadata">

**Author:** ![kirilltitov](https://sea2.discourse-cdn.com/swift/user_avatar/forums.swift.org/kirilltitov/32/4182_2.png) [@kirilltitov](https://forums.swift.org/u/kirilltitov)\
**Post date:** [March 26, 2019, 1:37pm UTC](https://forums.swift.org/t/swiftnio-2/22136/13 "2019-03-26T13:37:30Z")

</div>

BTW, I think you could elaborate more on `ChannelError.connectFailed` deprecation. I mean, it took me some time to figure out that it has been _kinda replaced_ by `NIOConnectionError`.

---

<div class="post-metadata">

**Author:** ![kylebrowning](https://sea2.discourse-cdn.com/swift/user_avatar/forums.swift.org/kylebrowning/32/9837_2.png) [@kylebrowning](https://forums.swift.org/u/kylebrowning)\
**Post date:** [March 26, 2019, 3:02pm UTC](https://forums.swift.org/t/swiftnio-2/22136/15 "2019-03-26T15:02:43Z")

</div>

For those looking to see an implementation of the HTTP2 client side of things, we do that [here](https://github.com/kylebrowning/swift-nio-http2-apns), specifically [APNSConnection.swift](https://github.com/kylebrowning/swift-nio-http2-apns/blob/master/Sources/NIOAPNS/APNSConnection.swift#L8), in the Swift NIO 2 Apple push notification service implementation.

---

<div class="post-metadata">

**Author:** ![kylebrowning](https://sea2.discourse-cdn.com/swift/user_avatar/forums.swift.org/kylebrowning/32/9837_2.png) [@kylebrowning](https://forums.swift.org/u/kylebrowning)\
**Post date:** [March 26, 2019, 3:09pm UTC](https://forums.swift.org/t/swiftnio-2/22136/17 "2019-03-26T15:09:26Z")

</div>

Thanks Helge, the pitch is [here](https://forums.swift.org/t/apple-push-notification-service-implementation-pitch/20193).

---

<div class="post-metadata">

**Author:** ![johannesweiss](https://sea2.discourse-cdn.com/swift/user_avatar/forums.swift.org/johannesweiss/32/38183_2.png) [@johannesweiss](https://forums.swift.org/u/johannesweiss)\
**Post date:** [March 26, 2019, 4:06pm UTC](https://forums.swift.org/t/swiftnio-2/22136/18 "2019-03-26T16:06:13Z")

</div>

> [@kirilltitov](#):
>
> BTW, I think you could elaborate more on `ChannelError.connectFailed` deprecation. I mean, it took me some time to figure out that it has been _kinda replaced_ by `NIOConnectionError` .

Here’s the [PR](https://github.com/apple/swift-nio/pull/690). Previously we had multiple different errors that could be thrown on connection failure, now it’s more unified and always uses `NIOConnectionError`. Did this lead to any issues for you?

---

<div class="post-metadata">

**Author:** ![Gabor\_Sebestyen](https://sea2.discourse-cdn.com/swift/user_avatar/forums.swift.org/gabor_sebestyen/32/326_2.png) [@Gabor\_Sebestyen](https://forums.swift.org/u/Gabor_Sebestyen)\
**Post date:** [April 5, 2019, 11:16am UTC](https://forums.swift.org/t/swiftnio-2/22136/19 "2019-04-05T11:16:38Z")

</div>

Congrats team! My pet project [OSCCore](https://github.com/segabor/OSCCore) already embraced NIO 2.
