Upgrade to Pro — share decks privately, control downloads, hide ads and more …

iOS App with VIPER Architecture

iOS App with VIPER Architecture

VIPER is an acronym for View, Interactor, Presenter, Entity and Router. It’s basically an approach that implements the Single Responsibility Principle to create a cleaner, more modular and testable structure for the iOS project. The idea behind this pattern is to isolate your app’s dependencies and balancing the delegation of responsibilities among the different layers.

Talk Video: https://www.youtube.com/watch?v=CQw2cDiRa_E

GitHub: https://github.com/suhitp/FlickrSearchApp

Twitter: https://twitter.com/suhit_rp
LinkedIn: https://in.linkedin.com/in/suhitt

Presented at Swift Mumbai Chapter 8 Meetup hosted by Eros Now
https://www.meetup.com/Swift-Mumbai/events/259194853/

Swift India

April 13, 2019
Tweet

More Decks by Swift India

Other Decks in Technology

Transcript

  1. –objc.io “Good architecture is not what makes a product successful,

    but it does make a product maintainable and helps preserve the sanity of the people maintaining it!”
  2. View •UI layer which displays information forwarded by Presenter •Pass

    user actions / events to Presenter •UIViewController subclass with UI Elements like UITableView/ UICollectionView etc.
  3. Interactor •Implements business logic as specified by the application UseCase

    •Interacts with outer services like Networking, Database •Networking and Database are services which gets injected as Dependancies •Pass the data in the form of Entities to Presenter
  4. Presenter •Handles the presentation logic for the View •Prepares the

    ViewModel required in the format required by the view •Invokes methods on the Interactor •Passes events to router for navigation •Independent of UIKit
  5. Cons •Highly increases the number of classes/protocols in the projects

    and complexity to create new modules. •Not much good examples and recommendations available online •Steep learning curve