Grpc example project for swift

Overview

How to gRPC on Swift Projects

This file aims to guide you to gRPC implementation on your swift project.

Installing the Protobuf Compiler

  • Open Terminal and download official protobuffer compiler

$ curl -LOk https://github.com/protocolbuffers/protobuf/releases/download/v3.5.1/protoc-3.5.1-osx-x86_64.zip

  • Unzip and cd to directory

$ unzip protoc-3.5.1-osx-x86_64.zip -d proto_buffer && cd proto_buffer

  • Copy files to paths inside your machine
$ sudo cp bin/protoc /usr/local/bin 
$ sudo cp -R include/google/protobuf/ /usr/local/include/google/protobuf
  • Protobuf compiler is now ready to use

Installing Swift Compilers

We need to get *.pb.swift file to run grpc on swift. Now,We will create this file.

  • Open Terminal and clone apple's protobuf repo on github

$ git clone https://github.com/apple/swift-protobuf

  • cd to clone and execute following on Terminal

$ swift build -c release

  • You can find the protoc-gen-swift binary file under the .build/realase. Copy this to /usr/local/bin

We also need *.grpc.swift file

  • Now clone another grpc repo for swift

$ git clone https://github.com/grpc/grpc-swift

  • cd to clone and execute the following

$ swift build -c release

  • You can find the protoc-gen-grpc-swift binary file under the .build/realase. Copy this to /usr/local/bin

Compiling .proto file

You are ready to create .pb.swift and .grpc.swift file using tge swift compilers we just installed

  • Navigate to the path that your proto file exists and run the following command in terminal
$ protoc --swift_out=. your.proto 
$ protoc --grpc-swift_out=. your.proto

There are 2 files that the compiler will create inside the directory, your.pb.swift and your.grpc.swift. Now we need to copy the files to our Xcode project. Make sure to check Copy Items if Needed.

You might also like...
ADVANCED APP DESIGN The main goal of this mini project is to inspire you on what we can accomplish with the SwiftUI framework.
ADVANCED APP DESIGN The main goal of this mini project is to inspire you on what we can accomplish with the SwiftUI framework.

Restart-App.0.2 ADVANCED APP DESIGN The main goal of this mini project is to inspire you on what we can accomplish with the SwiftUI framework. COMPLEX

EasyImplementationAlamoFire - An iOS project to demonstrate the usage of Alamofire in an efficient and organised way.

EasyImplementationAlamoFire Tutorial to demonstrate an efficient way of handling the APIs structure for your iOS Applications. Prerequisites Swift 5 X

iOS client for the Brewfactory project - brew your own beer
iOS client for the Brewfactory project - brew your own beer

BrewMobile iOS client for the Brewfactory project. Read the stories of upgrading BrewMobile to ReactiveCocoa & Swift on AllTheFlow. What is this? App

Demo project to try WebRTC native bindings in .net MAUI

MAUI.WebRTC.Demo Demo project to try WebRTC native bindings in .net MAUI. There are two projects with Xamarin bindings https://github.com/melihercan/W

Server-side Swift. The Perfect core toolset and framework for Swift Developers. (For mobile back-end development, website and API development, and more…)
Server-side Swift. The Perfect core toolset and framework for Swift Developers. (For mobile back-end development, website and API development, and more…)

Perfect: Server-Side Swift 简体中文 Perfect: Server-Side Swift Perfect is a complete and powerful toolbox, framework, and application server for Linux, iO

Socket framework for Swift using the Swift Package Manager. Works on iOS, macOS, and Linux.

BlueSocket Socket framework for Swift using the Swift Package Manager. Works on iOS, macOS, and Linux. Prerequisites Swift Swift Open Source swift-5.1

Swift Express is a simple, yet unopinionated web application server written in Swift
Swift Express is a simple, yet unopinionated web application server written in Swift

Documentation h5 align="right"a href="http://demo.swiftexpress.io/"Live 🐧 server running Demo img src="https://cdn0.iconfinder.com/data/icons/

Swift backend / server framework (Pure Swift, Supports Linux)

NetworkObjects NetworkObjects is a #PureSwift backend. This framework compiles for OS X, iOS and Linux and serves as the foundation for building power

Swift-multipart-formdata - MultipartFormData: Build multipart/form-data type-safe in Swift

MultipartFormData Build multipart/form-data type-safe in Swift. A result builder

Owner
Mert Gürcan
Junior iOS developer
Mert Gürcan
Grpc example project for swift

How to gRPC on Swift Projects This file aims to guide you to gRPC implementation on your swift project. Installing the Protobuf Compiler Open Terminal

Mert Gürcan 0 Dec 8, 2021
Codegeneration tool for isomorphic server and mobile Go apps with gRPC & Protobuf.

Codegeneration tool for isomorphic server and mobile Go apps with gRPC & Protobuf. Share code between your backend, Android & iOS app!

Kirill Biakov 17 Jun 25, 2020
CI Example Project

BookStore ?? 한글 버전 See new releases and search for programming books from IT Bookstore API This is a sample app to practice using Result type, stubbin

Danny Gilbert 0 Nov 3, 2021
Layer + Parse iOS Example (Swift)

Note: I no longer actively working on this project. If you encounter any problem, please open an issue and hopefully the community will help out. If y

Kien 119 Feb 10, 2022
Klab Academy, example of calling APIs in flutter

klab A new Flutter application. Getting Started This project is a starting point for a Flutter application. A few resources to get you started if this

Hubert IT 0 Dec 2, 2021
Shawn Frank 2 Aug 31, 2022
The core LibP2P Interfaces / Protocols and Abstractions backing the swift-libp2p project

LibP2PCore The core LibP2P Interfaces / Protocols and Abstractions backing the swift-libp2p project Table of Contents Overview Install Usage Example A

null 4 Dec 28, 2022
MVVM project to show AQI of cities via web socket

Air Quality Monitoring Application Swift project with JSON parsing using codable About the application The app consists of live realtime data from the

Pran Kishore 0 Nov 27, 2021
iOS Project Manager Client

08-iOS-Project-Manager-Client 프로젝트 매니저 STEP 1 프로젝트 할일 리스트 기능구현 UI구현방식 : 코드 아키텍쳐 : ProjectManagerViewController : NavigationViewController위에 StackView(

Kioding87 1 Nov 19, 2021
Little project I wrote a while ago I decided to clean up and upload.

ImageSearch About The project uses the Pixabay (https://pixabay.com/) API to show images relating to entered text. The app is built using an MVVM arch

Jay Bennett 0 Dec 7, 2021