This is a simple example of a mvvm login controller with ReactiveKit. You can find more details about this sample on this post on Medium
##Setup
- Run
pod install - Replace
private let url = "your.url.here"inLoginApi.swiftwith your server url. For testing you can create your own fake login server as described bellow - Run sample
Inside FakeLoginServer folder there's a javascript file with a fake login server that returns a successful response when user = testuser and password = 1234 and an error message otherwise.
You can deploy this file easily with Webtask:
- Install WebTask CLI
$ npm i -g wt-cli
$ wt init
- Navigate to FakeLoginServer folder and run
wt create FakeLoginServer.js
Now just copy the url returned from the cli and paste it in LoginApi.swift