Update Readme to recommend using Xcode package support (#59)

* Include updated wording about including NIO Transport Services in a project

* Add clause about usage in Xcode 10

* Update README.md

Commit suggestion

Co-Authored-By: Cory Benfield <lukasa@apple.com>
This commit is contained in:
Thomas Krajacic 2019-10-11 17:45:37 +02:00 committed by Cory Benfield
parent 98663f6026
commit 4add2df501
1 changed files with 16 additions and 5 deletions

View File

@ -16,22 +16,33 @@ Network.framework is Apple's reference implementation of the [proposed post-sock
## How to Use? ## How to Use?
Today, the easiest way to use SwiftNIO Transport Services in an iOS project is through CocoaPods: NIO Transport Services primarily uses SwiftPM as its build tool, so we recommend using that as well. If you want to depend on NIO Transport Services in your own project, it's as simple as adding a dependencies clause to your Package.swift:
```
dependencies: [
.package(url: "https://github.com/apple/swift-nio-transport-services.git", from: "1.1.1")
]
```
and then adding the NIOTransportServices module to your target dependencies.
If your project is set up as an Xcode project and you're using Xcode 11+, you can add NIO Transport Services as a dependency to your Xcode project by clicking File -> Swift Packages -> Add Package Dependency. In the upcoming dialog, please enter `https://github.com/apple/swift-nio-transport-services.git` and click Next twice. Finally, make sure `NIOTransportServices` is selected and click finish. Now will be able to `import NIOTransportServices` in your project.
You can also use SwiftNIO Transport Services in an iOS project through CocoaPods:
pod 'SwiftNIO', '~> 2.0.0' pod 'SwiftNIO', '~> 2.0.0'
pod 'SwiftNIOTransportServices', '~> 1.0.0' pod 'SwiftNIOTransportServices', '~> 1.0.0'
You can also use the Swift Package Manager: If you want to develop SwiftNIO with Xcode 10, you have to generate an Xcode project:
``` ```
swift build swift package generate-xcodeproj
``` ```
and add the project as a sub-project by dragging it into your iOS project and adding the frameworks (such as `NIO.framework`) in 'Build Phases' -> 'Link Binary Libraries'. and add the project as a sub-project by dragging it into your iOS project and adding the framework (`NIOTransportServices.framework`) in 'Build Phases' -> 'Link Binary Libraries'.
Do note however that Network.framework requires macOS 10.14+, iOS 12+, or tvOS 12+. Do note however that Network.framework requires macOS 10.14+, iOS 12+, or tvOS 12+.
## Versioning ## Versioning
Just like the rest of the SwiftNIO family, `swift-nio-transport-services` follows [SemVer 2.0.0](https://semver.org/#semantic-versioning-200) with a separate document Just like the rest of the SwiftNIO family, `swift-nio-transport-services` follows [SemVer 2.0.0](https://semver.org/#semantic-versioning-200) with a separate document