https://github.com/kitasuke/swiftprotobufsample
Sample project for client/server in Swift with Protocol Buffers
https://github.com/kitasuke/swiftprotobufsample
ios json kitura protobuf protocol-buffers server-side-swift swift swift-protobuf
Last synced: about 1 year ago
JSON representation
Sample project for client/server in Swift with Protocol Buffers
- Host: GitHub
- URL: https://github.com/kitasuke/swiftprotobufsample
- Owner: kitasuke
- License: mit
- Created: 2016-12-18T22:29:48.000Z (over 9 years ago)
- Default Branch: master
- Last Pushed: 2021-06-03T02:19:24.000Z (about 5 years ago)
- Last Synced: 2023-03-01T19:51:18.516Z (over 3 years ago)
- Topics: ios, json, kitura, protobuf, protocol-buffers, server-side-swift, swift, swift-protobuf
- Language: Swift
- Size: 1.86 MB
- Stars: 12
- Watchers: 3
- Forks: 2
- Open Issues: 1
-
Metadata Files:
- Readme: README.md
- License: LICENSE
Awesome Lists containing this project
README
# SwiftProtobufSample
Sample project with Protocol Buffers for client/server in Swift
## Sample apps
### Client app
APIClient uses `URLSession` with [swift-protobuf](https://github.com/apple/swift-protobuf)
### Server app
Web framework, [Kitura](http://www.kitura.io/) provides HTTP server with [swift-protobuf](https://github.com/apple/swift-protobuf)
## Requirements
Swift 3.1
Xcode 8.3
protoc 3.2
swift-protobuf 0.9.903
Kitura 1.3
Carthage 0.20
## Setup
### Protocol Buffers
Follow [this instruction](https://github.com/google/) to install protoc
### Plugin for Swift
Follow [this instruction](https://github.com/apple/swift-protobuf#build-and-install) to install swift-protobuf
### Code Generator
Run command below to generate swift files from proto files
```
$ make generate
```
### Dependencies
Run command below to install libraries for Server/Client app
```
$ make setup
```
## Usage
### Server app
Run command below to run server app
```
$ make run-server
```
### Client app
Open `Client.xcodeproj` and simply run it.
## Reference
https://developer.ibm.com/swift/2016/09/30/protocol-buffers-with-kitura/
https://github.com/KyoheiG3/ProtobufExample