Skip to content
Ryan Bush edited this page May 2, 2017 · 11 revisions

iOS is still a very young technology and as you may have found out an MVC architecture is anything but useful for long running applications. The fuboTV iOS application is adopting the VIPER architecture throughout.

What VIPER Is

VIPER is a 6 tier architecture that abstracts module tasks into each tier such that everything has a single responsibility. Its conforms to SOLID design principles and is an implementation of Clean Architecture concepts.

Main Goals Of VIPER:

  • Make code easy to iterate on
  • Make projects collaboration-friendly
  • Create reusable modules with separated concerns
  • Make code easy to test

A very simplistic representation would be:

A VIPER Stack

Most connections are two way and each direction is abstracted into an interface. For example:

  • Wireframe talks to the Presenter through the WireframeToPresenterInterface
  • Presenter talks to the Wireframe through the PresenterToWireframeInterface

The abstracted interfaces provide us with a way to easily conform to the interface (Goal 2 & 3). This lets us easily replace objects by creating new objects that only need to implement the interfaces (Goal 1 and 3). This also lets us create mock objects that can easily be injected for testing (Goal 4).

What VIPER Is NOT

VIPER is not the end all of architectures. It solves many problems that arise from MVC, but sometimes the technology of our IDE's doesn't mix well (ex: storyboards and segues). If you see a way to improve VIPER, please be vocal, we want it to improve!