Code challenge for SoundCloud iOS interview
Swift
Switch branches/tags
Nothing to show
Clone or download
Fetching latest commit…
Cannot retrieve the latest commit at this time.
Permalink
Failed to load latest commit information.
Doc
SoundCloudMemoryGame.xcodeproj
SoundCloudMemoryGame
TestResources
.gitignore
Cartfile.resolved
README.md
Scanfile
cartfile

README.md

SoundCloudMemoryGame

Requirements

  • iOS 9.3+
  • Xcode 8.2+
  • Swift 3.0+

How to run the project

The project uses Carthage for dependency management.

You can install Carthage with Homebrew using the following commands:

$ brew update
$ brew install carthage

After the installation, run the following command in the root directory of the project:

carthage bootstrap --platform iOS --no-use-binaries

When Carthage install all dependencies, you can open SoundCloudMemoryGame.xcodeproj.

⚠️ SoundCloudAPI Client ID ⚠️ Before running the project, make sure to add the value for SCAPIClientID key into the info.plist file.

Architecture

When possible (and suitable), SoundCloudMemoryGame follows MVVM architecture and functional reactive programming principles. RxSwift is used in the majority of the app to make the code simpler and more expressive.

Project structure

Instead of having root folders like ViewControllers Views etc. with all view controllers and views inside them, I decided to group them according to the scene they belong to. It's much easier to work on the particular scene when all the elements are at the one place. Elements, which are meant to be reusable, are then located inside corresponding root folders.

Project structure

Tests are first class citizens! Inspired by this interesting article, I placed test files to the same folder as the implementation files. It's much easier to work on a given class when you don't have to jump up and down in the project structure.

Testing

The project has two levels of tests:

Behavior tests

The project uses Quick for behavior-driven testing and Nimble as a matcher framework. Behavioral tests are focused on testing the proper behavior of the system. They are used mainly for non-view classes.

Snapshot tests

Snapshot tests are meant to be used for testing views. The project uses FBSnapshotTestCase for generating and comparing snapshots. For seamless integration with Quick, there's Nimble-Snapshots, a Nimble matcher wrapping FBSnapshotTestCase.

If you want to test the project for various system versions and devices, you can use Fastlane and simply run:

fastlane scan

Please note, that you have to have the following simulators installed in the system: ["iPhone 6 (9.3)", "iPhone 6 Plus (9.3)", "iPhone 6 (10.2)", "iPhone 6 Plus (10.2)"].