Czajnikowski / Babylon

My demo submission to Babylon Health

Geek Repo:Geek Repo

Github PK Tool:Github PK Tool

Hello Babylon

Thank you for taking the time to consider my demo during the recruitment process for the Remote Senior iOS Developer position at your company. I'd be more than happy to join your impressing team.

Initially I prepared the demo as an assignment in the interview process for Babylon Health. I actually passed the demo stage and scored "very well", but the company decided to pause on hiring new remote engineers just a day before my Skype interview. Well πŸ€·πŸΌβ€β™‚οΈ

It's a pretty generic demo though. You may find some interesting bits there if you're interested in SwiftUI, Combine, Playground Driven Development or architecture. I appreciate constructive critique as well πŸ™‚

Demo

As a demo, I've chosen The babylon demo project.

Requirements

Xcode 11 Beta 5, no Catalina needed.

Dependencies

I decided to stick to the native frameworks, so there are no 3rd party dependencies by now. The main frameworks of my choice are:

  • Combine for reactive programming
  • SwiftUI for the View layer
  • Foundation for networking and caching

Architecture

The responsibilities of the app are split across three separate frameworks and the app target itself:

  1. View - leaf framework concerned just about the presentation layer.
  2. Networking - leaf framework concerned about networking.
  3. ViewModel - framework depending on both Networking and View concerned about the bidirectional mapping of data between the View and underlying logic and services.
  4. Babylon app target - main target where dependency injection takes place via the Coordinator

There is a subtle difference between classic MVVM and my approach. In classic MVVM the View layer depends on ViewModel and in my approach, the ViewModel depends on the View.
Such dependency graph makes View a decoupled, leaf framework making it easy to compile, develop and test independently. Thanks to it I've been able to leverage the Playground Driven Development technique to implement and troubleshoot both view's implementations (see *.playground in the project).
The frameworks are additionally extracted into separate projects. This makes presumable cross-team development less prone to merge conflicts.

Tests

I've written two, taking PostListViewModel under test (see PostListViewModelTests or Cmd + U on the Babylon scheme).
I've been trying to incorporate snapshot testing as well (see snapshot_testing branch) using FBSnapshotTestCase by Uber, but it doesn't seem to work well with SwiftUI at the moment.

Known issues

Requirements checklist

βœ… Swift 5.1.
βœ… The information is available offline by leveraging the URLCache. The quickest-to-implement solution I can imagine.
βœ… Reloading available as a navigation bar item in PostListView.
βœ… Have a point of synchronization in PostDetailsViewModel.loadData(), I used a Zip for that.
βœ… I find the code to be production grade. Not production ready though (uses iOS SDK beta 3).
βœ… It compiles and runs.

About

My demo submission to Babylon Health


Languages

Language:Swift 95.8%Language:Objective-C 4.2%