VIPER is an application of Clean Architecture to iOS apps.
Questions tagged [viper-architecture]
127 questions
5
votes
2 answers
Routing Viper architecture
How to create good routing in project on Viper architecture? I start create file for routing but i don't understand what i must do next.
I create a file wireframe first controller and wireframe protocol:
// …

Andrei Trotsko
- 347
- 2
- 12
5
votes
2 answers
Where to place UIView animation code in VIPER?
Where should UIView animation code be placed according to the VIPER design pattern?
Should it be in the View or in the Presenter?
Note:
I have a CustomView that I wish to move across the Screen once touched.
The CustomView is added to the Screen in…

Ríomhaire
- 3,084
- 4
- 25
- 40
4
votes
1 answer
Combine - Subscriber gets cancelled silently when subscribing a second time
I am trying to replace delegation pattern with Combine.
The architecture of my app is a VIPER, so I need to pass the sink subscriber from one module to another. The use case is i have data from module A (list) that needs to be show to module B…
user13611542
4
votes
1 answer
unit testing VIPER protocols
After reading several posts and articles about this issue I'm still confused about how to test a method in a VIPER architecture (for example with Swift).
If I had this code:
Presenter class
protocol InteractorToPresenterProtocol: class {
func…

Wonton
- 1,033
- 16
- 33
4
votes
1 answer
Clean Architecture - Should simple view logic be on Presenter or on View?
I have a simple example:
A user selects a Date from a Calendar, then that date is set in a label. When there is no date or an invalid date is selected, a placeholder must be placed instead.
My question is, which of these better approaches Clean…

htafoya
- 18,261
- 11
- 80
- 104
4
votes
1 answer
Where should I put Core Location methods in a VIPER/MVP iOS project?
I searched a lot, I understand that the view controller is actually the "View" in the Viper or MVP architecture and the Presenter contains the logic... But since the presenter should be easy testable, is it good to put Core Location stuff (like…

Rico Crescenzio
- 3,952
- 1
- 14
- 28
4
votes
3 answers
Where and how to perform segues in VIPER architecture?
As a beginner, I used to perform segues in ViewControllers. Moreover, Apple encourages such approach, because UIViewController has methods performSegue and prepareForSegue.
But learning VIPER, I read that Router is responsible for transitions…

Gleb Kalachev
- 123
- 1
- 7
4
votes
3 answers
Implementation of UITableView delegate and datasource in VIPER
I'm writing an app in VIPER architecture for the first time, and can't understand if the UITableView delegate and datasource methods should go into the View, Presenter or the Interactor? I found in some links that it should be part of View class,…

danialzahid94
- 4,103
- 2
- 19
- 31
4
votes
1 answer
BLE in iOS with VIPER
I am developing an iOS BLE application and everything works great. I am handling BLE in a singleton class that calls its discoverPeripheral() method in the view controller's viewDidAppear(). From there on I connect with devices and exchange…

Sundus Alamovic
- 322
- 2
- 18
4
votes
3 answers
Two view controllers with similar functionality VIPER
I'm currently trying to implement VIPER-architecture in my project, and there is some questions I encountered with.
I have two modules in my app, that have some similar functionality (they both have imagePicker and ability to upload media to server,…

A. Buksha
- 830
- 9
- 14
4
votes
2 answers
Block Callbacks or Protocols to pass information between DataManager and Interactor in VIPER?
When using Objective-C which is the preferred method to pass objects from the DataManager to the Interactor when utilising the VIPER architectural pattern.
In particular use of Block Based Callbacks vs. a DataManager Output Protocol
The Sample To Do…

Ríomhaire
- 3,084
- 4
- 25
- 40
4
votes
2 answers
Why protocols are used in both direction in VIPER architecture rather than in one direction
We want to change my architecture from MVC to VIPER. I read basic tutorial by following http://mutualmobile.github.io/blog/2013/12/04/viper-introduction/
source code link : https://github.com/mutualmobile/Counter
- (void)createScreen
{
…

MuraliMohan
- 1,063
- 1
- 11
- 30
4
votes
1 answer
How to setup asynchronous image loading using VIPER artechiture?
The nature of the app is a UITableView that displays UIImages on every row as the user scrolls down the tableView. How should i load the image into the cell without breaking VIPER architecture?
--VC code--
func cellForRowAtIndexPath...... {
var…

Just a coder
- 15,480
- 16
- 85
- 138
3
votes
1 answer
Presenter gives nil error in the VIPER Project
In the project I made with Viper, the presenter in ViewController gives a nil error. What is the reason of this? And how can I solve this problem?
AppDelegate
let wireframe = MovieWireframe()
let movies = wireframe.createMovieController()
window =…

Corbars
- 31
- 1
- 2
3
votes
0 answers
Is this the correct way to write unit test for Interactor in VIPER, swift, iOS?
I have a small sorting function in the Interactor which takes a set of Strings and sort it and notify to the Presenter. That function works as expected.
Now I'm just trying cover that function with unit test. so I created a Unit Test Class for my…

Marlon Brando aka Ben
- 863
- 1
- 14
- 33