juanpe / swift-viper-module Goto Github PK
View Code? Open in Web Editor NEWXcode template for VIPER Architecture written in Swift 4
Xcode template for VIPER Architecture written in Swift 4
install.swift:58:16: error: subscripts returning String were obsoleted in Swift 4; explicitly construct a String from subscripted result
return output[output.startIndex ..< lastIndex]
In my understanding, the Router should hold Presenter only, not Controller.
But in your VIPER framework, the controller is held by Router.
class LoginRouter: LoginWireframeProtocol {
weak var viewController: UIViewController?
static func createModule() -> UIViewController {
// Change to get view from storyboard if not using progammatic UI
let view = LoginViewController(nibName: nil, bundle: nil)
let interactor = LoginInteractor()
let router = LoginRouter()
let presenter = LoginPresenter(interface: view, interactor: interactor, router: router)
view.presenter = presenter
interactor.presenter = presenter
router.viewController = view
return view
}
}
sudo swift install.swift
Password:
install.swift:58:16: error: subscripts returning String were obsoleted in Swift 4; explicitly construct a String from subscripted result
return output[output.startIndex ..< lastIndex]
^~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~
String( )
In Xcode8 ModuleAProtocols.swift file will creat code
“protocol ModuleAWireframeProtocol: class {
}”
but in Xcode9 it will be
“protocol ModuleAProtocolsWireframeProtocol: class {
}”
How do you modify this?
Thanks for your great template! I m new to VIPER, I can not find a elegant way to pass data between 2 modules.
Hi Juanpe, this is not an issue. I just came across this repo and wanted to study your code and understand how you decided to come up the code for installation and other files.
I also tried reading about process and pipe on apple documentation on swift but found it to be an abridged version hence couldn't understand your logic.
Please mail me on [email protected].
Thanks :)
Hi it would be very nice to have a very simple example using it. i.e. just 2 modules that do nothing but show how to load the root one from the app delegate and load another one from it. I'm new to viper and every source have a way to do it so I'd like to know your way because i'm gonna use your template :)
Hi, I've been testing others viper generator and some use __moduleName__Contracts for the protocol file. I think that nice as this file represent how to interact with the module. Also the protocols name is kinda too generic and could have other uses into projects like the delegate of the module.
it would be nice to create a folder Structure when add files
I tested this template some weeks ago and I found the Interactor has a reference to the presenter. Conceptually, I find it wrong. The domain layer should be as decoupled as possible from the presentation and data layer.
The most common approach is making the presentation and domain layers communicate trough callbacks, so the interactor doesn't know to wich presenter is related.
Probably you already know this but just in case I tell you: think in the interactor like a lego piece. You should be able to change the piece you have over it (presenter in this case) without touching a single line.
install.swift:55:15: warning: 'characters' is deprecated: Please use String or Substring directly
if output.characters.count > 0 {
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.