Make it possible to generate Realm objects in Swift in according to your Protocol Buffers schemes. There is a runtime library for working with generated objects, for more information: Protobuf Swift Realm
Required Protocol Buffers for Swift
1.git clone "https://github.com/alexeyxo/protobuf-swift-realm-compiler.git" && cd protobuf-swift-realm-compiler
2.make install
protoc -I ./<DESC_DIR> ./<FILENAME>.proto --swift_realm_out="./<OUT_DIR>"
- DESC_DIR: path to folder that contains
/google/protobuf/descriptor.proto
&/google/protobuf/swift-descriptor.proto
- FILENAME.proto: path to your protobuf models, it's possible to set
*.proto
for getting all proto files - OUT_DIR: output path for generated files
Directory structure (/project):
- /protobuf
- /google/protobuf
- /descriptor.proto
- /swift-descriptor.proto
- /Employee.proto
- /google/protobuf
- /ios
- /ProtoApi.Employee.realm.swift
Run command:
cd project && protoc -I ./protobuf ./protobuf/Employee.proto --swift_realm_out="./ios"