Questions tagged [viper-architecture]

VIPER is an application of Clean Architecture to iOS apps.

127 questions
40
votes
3 answers

Questions about VIPER - Clean Architecture

I've been reading about Clean Architecture from Robert Martin and more specifically about VIPER. Then I ran into this article/post Brigade’s Experience Using an MVC Alternative which describes pretty much what I'm currently doing. After actually…
23
votes
6 answers

iOS using VIPER with UITableView

I have a view controller which contains a table view, so I want to ask where should I put table view data source and delegate, should it be an external object or I can write it in my view controller if we say about VIPER pattern. Normally using…
Matrosov Oleksandr
  • 25,505
  • 44
  • 151
  • 277
20
votes
1 answer

How to understand the VIPER clean architecture?

I recently discovered VIPER clean architecture and I started looking for sample tutorials on applying this architecture on the Android platform. However, what I only found was sample projects which were confusing to me that is why I want to follow a…
17
votes
3 answers

How a UITabBarController fit into the VIPER architecture?

I am writing an application which has a TabBar based navigation. I am adopting the VIPER architecture but I am really confused with the topic of how a UITabBarController's tab changing should be implemented.
Tibor Molnár
  • 197
  • 2
  • 8
12
votes
3 answers

Can not send data to another module in VIPER

How can i send data from Module A to Module B in VIPER? I use router A, which has information for Module B, and try to send this information to view controller B or presenter B. What is the best way to do it?
10
votes
3 answers

HowTo make Xcode recognize custom templates

I've been using Generamba to create template files for each module under VIPER architecture for iOS. It saves a lot of time, but still needs commands through terminal to run Generamba and create the files. Does anyone have a clue on how to embed…
Marcelo Gracietti
  • 3,121
  • 1
  • 16
  • 24
8
votes
1 answer

Where does notification observers fit in the VIPER pattern?

I am changing my project to VIPER pattern. I got a lot of observers for my main view. I don't find where should I place my observers in VIPER . Because i don't want to place my observer in view . Previously I had separate class for observers and…
user3804063
  • 809
  • 1
  • 14
  • 32
8
votes
4 answers

iOS VIPER: where to put the form validation code?

I read many articles about the clean iOS architecture VIPER, I understand the main puropose: the separation of concerns. I currently use it for my project. I have modules, each split by Views, Interactors, Presenters, Entities and Routers (with…
ludriv
  • 291
  • 1
  • 6
  • 15
7
votes
2 answers

Which it is the place for NSFetchedResultsController in VIPER architecture?

In VIPER, unlike the MVC, the role and place not so clearly defined for NSFetchedResultsController. Is it right to place it on the interactor?
David
  • 1,152
  • 16
  • 24
6
votes
1 answer

Pass data to previous viewcontroller VIPER

I am using VIPER architecture in iOS swift. I have 2 viewcontrollers, let's say A and B. At first I'm going from A to B, performing some tasks and coming back from B to A. With MVC or MVVM, we can create protocols and transfer data from B to A. But…
Arnab
  • 4,216
  • 2
  • 28
  • 50
6
votes
1 answer

How to pass ViewController Reference to Router in VIPER design pattern?

P.S: This is not a opinionated question. Its a legitimate doubt on wiring various modules in VIPER. Its a theoretical question so no code attached. I just need to know how do we wire up View-Presenter-Router in this specific case without breaking…
Sandeep Bhandari
  • 19,999
  • 5
  • 45
  • 78
5
votes
1 answer

Should I use a PublishSubject if I am notifying an action is complete?

I am learning Viper w/ RxSwift. I would like to notify my Presenter that viewDidLoad was called in my ViewController. To do this I have the following: class LoginPresenter { weak var view: LoginView? var interactor: LoginUseCase? var…
Tim J
  • 1,211
  • 1
  • 14
  • 31
5
votes
2 answers

VIPER architecture: submodules in a module

I have a VIPER module (SubjectList) in which I want to have a more generic HeaderModule, with a SubjectListCollectionModule and a BlockModule. At what point would I logically add the HeaderModule? I could include the modules in the…
jbehrens94
  • 2,356
  • 6
  • 31
  • 59
5
votes
1 answer

How do notifications fit in iOS VIPER architecture?

I was looking at VIPER architecures and I was wondering where notifications would go in the app. I use Realm local database which has the ability to send notifications when models are updated. Do notifications get broadcasted from the INTERACTOR -->…
Nader Besada
  • 369
  • 5
  • 12
5
votes
3 answers

Use of NSFetchedResultsController in Clean Architecture

I've searched for an answer to this without much luck. This question is pretty much the same but the answer isn't very clear (at least to me!): Which it is the place for NSFetchedResultsController in VIPER architecture? The…
1
2 3
8 9