Stocks is an iOS app written in Swift using the VIPER Architecture. The idea behind making this app was to keep API contracts(models) in sync with the backend and avoid hassles of writing of same type of code in both iOS and Android. To achieve that I have created a separate repo for the models used in the iOS app which is addes as Swift Package dependency. I am running a local pipeline to generate models using protoc
with plugins for Swift and Golang. Check the Makefile to know more about it. After generating the models locally these models are then pushed to the stock-contracts-ios. I haven't automated the new release for this repo yet.
-
Xcode 11
-
Swift 5.1
-
Cocoapods 1.7.5
-
Swift Protobuf
-
Protoc
Instead of using JSON files for API responses I have used Protocol Buffers. Protocol buffers are smaller in size and very simple to write. You can find the .proto
files in the protos/models directory.
Install Cocoapods
brew install cocoapods
Install Swift Protobuf
brew install swift-protobuf
This will install protoc
compiler and Swift code generator plugin.
If you want to run this app and test the functionality, you also need to setup a local server from this repo.