infinum / ios-viper-xcode-templates Goto Github PK
View Code? Open in Web Editor NEWUsed for generating template files for the VIPER architecture, which solves the common Massive View Controller issues in iOS apps.
License: Apache License 2.0
Used for generating template files for the VIPER architecture, which solves the common Massive View Controller issues in iOS apps.
License: Apache License 2.0
I have a TabbarController and each of the tab should have their own UINavigationControllers.
How to implement it with VIPER? Because each of the init method of each Wireframe assumes there had already been a navigationController provided.
Please make VIPER modules have an option to generate without the use of UIStoryboard. I've found that compile times are much quicker without storyboards.
I had tab bar support manually added to previous version but if it could be added natively to this repository that would be great
I would like the option for the Wireframe
classes to be storyboard or non interface builder view controller based.
//
// LoginWireframe.swift
// ViperExample
//
// Created by Jerome Isaacs on 8/9/19.
// Copyright (c) 2019 r4e. All rights reserved.
//
// This file was generated by the ๐ VIPER generator
//
import UIKit
final class LoginWireframe: BaseWireframe {
// MARK: - Private properties -
private let storyboard = UIStoryboard(name: "<#Login#>", bundle: nil)
// MARK: - Module setup -
init() {
let moduleViewController = storyboard.instantiateViewController(ofType: LoginViewController.self)
super.init(viewController: moduleViewController)
let interactor = LoginInteractor()
let presenter = LoginPresenter(view: moduleViewController, interactor: interactor, wireframe: self)
moduleViewController.presenter = presenter
}
}
// MARK: - Extensions -
extension LoginWireframe: LoginWireframeInterface {
}
In this case, I would've liked the ability to pick between a storyboard or instantiating a view controller directly.
Screenshot for reference:
https://scr.infinum.co/adis/SettingsWireframe.swift__Edited_2018-03-23_11-54-06.png
Should we replace import UIKit
with import Foundation
in presenter.
Why the presenter template imports UIKit, since presenter has to be UIKit independant?
I would like to discuss merging feature/v2
branch to master
.
First I would like if you could go over the proposed changes to settle all creative differences.
In the latest version of the VIPER generator, when Rx version is selected, enum ModuleName
with ViewOutput and ViewInput is created on the top of the file, before other protocol
s.
The proposal is to move that enum at the bottom of the interface file so that protocol
s are first listed. The main reason is that Interactor should have most of the business logic inside and as in Wireframe navigation enum is removed, we will have more navigation methods listed there. In most cases, ViewInput
/ ViewOutput
will have generic properties like close
, add
, items
, buttonState
, etc. that are not so useful to see first in the Interfaces file.
This change could lead to a better file organization and easier information search as the main interfaces are on top. ViewInput
/ ViewOutput
structs are just structs used in the configure(with:
method and therefore it is ok to have them at the end of the file.
Should we move ViewInput
/ ViewOutput
to the end of the Interfaces
file?
/polls Yes No
The VIPER is great and I have 2 questions:
In the latest version of the VIPER generator, when Rx version is selected, enum ModuleName
with ViewOutput and ViewInput is created on the top of the file, before other protocol
s.
The proposal is to move that enum to the bottom of the interface file so that protocol
s are first listed. The main reason is that Interactor should have most of the business logic inside and as in Wireframe navigation enum is removed, we will have more navigation methods listed there. In most cases, ViewInput
/ ViewOutput
will have generic properties like close
, add
, items
, buttonState
, etc. that are not so useful to see first in the Interfaces file.
This change could lead to a better file organization and easier information search as the main interfaces are on top. ViewInput
/ ViewOutput
structs are just structs used in the configure(with:
method and therefore it is ok to have them at the end of the file.
Should we move ViewInput
/ ViewOutput
to the end of the Interfaces
file?
I have a scenario where user goes to next page, by pushing view controller. The next page has a collectionView and an API call, if user goes to next page, API is called and based on response collectionView is reloaded. Now, if user clicks back button very quickly(before response comes), so view controller is destroyed from memory, but since the view reference was unowned private unowned let view: KBPlusMemberDetailViewInterface
, it still exists. Now, user is on the previous page and the API gives data on next page, and self.view.collectionView.reloadData() is called on the next page(which is not in memory anymore), but since self is destroyed, so the app is crashed. How can we solve this?
Hi, after completing my first Viper project (and creating everything by hand) I decided to try your templates for the next project.
I have a question regarding the Interactor in your templates. Why is there no connection to a presenter? How can the Interactor respond to the presenter (Interactor output). I saw in your examples you are using callbacks. Is this how you imagined it in this template? Or am I missing something?
tl;dr why does the Interactor not have access to a weak presenter property for his output?
What should we rename this function name in ViewController?
configure
(leave as is)configureIO
setupView
Thanks for great viper implementation.
I want to have BasePresenter
class and BaseInteractor
class like BaseWireFrame
to add some base stuffs, is there any way to make sure generated interactors and presenters are extending from my new base classes?
Please, could you give the better way to integrate with Interactor?
Thanks ;)
yes, my documents folder on my Mac is now completely empty. I might have tried installing incorrectly but why would it delete all my documents in my documents folder?
There is no mention on what command to use to use module generator.
A declarative, efficient, and flexible JavaScript library for building user interfaces.
๐ Vue.js is a progressive, incrementally-adoptable JavaScript framework for building UI on the web.
TypeScript is a superset of JavaScript that compiles to clean JavaScript output.
An Open Source Machine Learning Framework for Everyone
The Web framework for perfectionists with deadlines.
A PHP framework for web artisans
Bring data to life with SVG, Canvas and HTML. ๐๐๐
JavaScript (JS) is a lightweight interpreted programming language with first-class functions.
Some thing interesting about web. New door for the world.
A server is a program made to process requests and deliver data to clients.
Machine learning is a way of modeling and interpreting data that allows a piece of software to respond intelligently.
Some thing interesting about visualization, use data art
Some thing interesting about game, make everyone happy.
We are working to build community through open source technology. NB: members must have two-factor auth.
Open source projects and samples from Microsoft.
Google โค๏ธ Open Source for everyone.
Alibaba Open Source for everyone
Data-Driven Documents codes.
China tencent open source team.