Welcome to Swift Protobuf!
Apple's Swift programming language is a perfect complement to Google's Protocol Buffer serialization technology. They both emphasize high performance and programmer safety.
This project provides the runtime library that is necessary for using code generated by the protoc Swift plugin. After using the protoc plugin to generate Swift code from your .proto files, you will need to add this library to your project.
For more information about Swift Protobuf, please look at:
If you are using the Swift Package Manager, this only requires adding one dependency to your Package.swift file:
dependencies: [
.Package(url: "https://github.com/apple/swift-protobuf-runtime.git",
Version(0,9,12))
]
To make sure you are using the correct library version here, run protoc-gen-swift with the --version option:
$ protoc-gen-swift --version
protoc-gen-swift 0.9.12
You should use the version of the swift-protobuf-runtime library that matches your protoc-gen-swift plugin.
If you are using Xcode, then you should:
- Add the Swift source files generated from your protos directly to your project
- Add the Protobuf target from the Xcode project in this package to your project.
If you run into problems, please send us a detailed report. At a minimum, please include:
- The specific operating system and version (for example, "macOS 10.12.1" or "Ubuntu 15.10")
- The version of Swift you have installed (from
swift --version) - The version of the protoc compiler you are working with from
protoc --version - The specific version of this source code (you can use
git log -1to get the latest commit ID) - Any local changes you may have