Swift-VIPER-Module - Xcode template for VIPER Architecture written in Swift 4

Overview

No Maintenance Intended

⚠️ Deprecated ⚠️

This library is deprecated.

When you decide to use VIPER architecture in your project, it is very tired create new modules, because you need create at least 5 files for each. Imagine that you need to create 6 modules...I was suffering this problem, and this is the raison why I've created this template. It's very useful for me and I hope that for you too.

How to install

Using script (easy)

Only need execute this command in terminal:

sudo swift install.swift

You should be this output message:

If all it's ok you now could find your template in Xcode.

Manual

Go to Application folder, browse to the Xcode application icon. Right-click it and choose 'Show Package Contents'. Then browse to: Contents/Developer/Platforms/iPhoneOS.platform/Developer/Library/Xcode/Templates/Project Templates/iOS/Application and add "Module VIPER.xctemplate" file. Now you can find your template in Xcode.

Easy to use

Generated code

This template generates all files that you need to create a new VIPER module. All generated code is Swift 3.

This is an example, we're creating a Login module:

VIPER diagram overview

Preview

Why VIPER?

After using VIPER, I've found it to be very beneficial in many ways. Let’s get back to the list of things we set out to accomplish when architecting our app to see if VIPER addresses them.

  • Easy to iterate on
  • Collaboration friendly
  • Separated out concerns
  • Spec-ability

Next steps

Would you like decide what will be the next feature? now, you can do it here

  • Create bash script to install more easy
  • Divide Interactor protocol (Input & Output) (NEW! Version 1.1)
  • Swift 4 & XCode 9 (NEW! Version 1.2)
  • Add Dependency Injection Framework
  • Customize name of components
  • Create groups in template (Only available for Project templates)

References

Contributed

This is an open source project, so feel free to contribute. How?

  • Open an issue.
  • Send feedback via email.
  • Propose your own fixes, suggestions and open a pull request with the changes.

Author

Comments
  • error installing with Swift 4

    error installing with Swift 4

    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( )

    bug 
    opened by jorgifumi 4
  • Simple example

    Simple example

    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 :)

    enhancement 
    opened by Alex293 3
  • Error Swift 4

    Error 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]

    duplicate 
    opened by infinitystar78 2
  • About Xocde9

    About Xocde9

    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?

    opened by xijiangyueal 1
  • Can't install ViperModule

    Can't install ViperModule

    Hi i tried to install the viper module with the below line of code in Terminal , but it is throwing an error, can you tell me the process how to install screen shot 2017-07-30 at 1 10 11 am

    duplicate question 
    opened by kishore4a2 1
  • Simple thoughts on naming

    Simple thoughts on naming

    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.

    enhancement 
    opened by Alex293 1
  • Add method to create module in router

    Add method to create module in router

    • Added a create module method in the router that returns the next view controller
    • This eliminates more redundant code that is necessary when creating new modules
    • Makes it more clear how the entities interact with each other for someone new to viper
    opened by bleedsy 1
  • - Using xcode-select to identify real Xcode path

    - Using xcode-select to identify real Xcode path

    There is a problem with install.swift script - if you have Xcode installed in different folder than default or if you have multiple Xcode versions it either fails or installs templates in wrong Xcode version.

    To fix this problem I suggest to use "xcode-select --print-path" command to get active Xcode path dynamically instead of hardcoded "/Applications/Xcode.app/Contents/Developer".

    opened by grzegorzkrukowski 1
  • Process and Pipe

    Process and Pipe

    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 :)

    opened by born-confused 0
  • Adds Dependency Injection mechanism and change protocol conformance

    Adds Dependency Injection mechanism and change protocol conformance

    This pull request aims to achieve a mechanism to provide dependencies to VIPER modules.

    The createModule method of Router class receives a ServiceLocator object as argument. This object provides all the dependencies of the app and will be used to provides dependencies of the module.

    In this way, the service locator object is passed between modules.

    An example of ServiceLocator implementation can be found here

    Apart from these modifications, I have moved the implementation of some protocols to extensions in order to improve legibility (https://github.com/raywenderlich/swift-style-guide#protocol-conformance)

    I understand that this pull request tie the user to use the proposed dependency injection mechanism, so I will understand that the PR will be rejected. Anyway, I hope it will be useful for someone.

    Thanks!

    opened by JesusMartinAlonso 0
Releases(1.1)
Owner
Juanpe Catalán
iOS Developer at Domestika
Juanpe Catalán
ViperC - Xcode template for VIPER Architecture for both Objective-C and Swift.

ViperC Xcode template for VIPER Architecture for both Objective-C and Swift. ViperC creates modules for you when you want to use VIPER architecture in

Abdullah Selek 79 Nov 2, 2022
Awesome-xcode-scripts - A curated list of useful xcode scripts 📝 .

Awesome Xcode Scripts A curated list of useful Xcode scripts ?? . Content How to Setup Scripts Build Number Auto-Increment Script Build Number Auto-In

Aashish Tamsya 110 Dec 26, 2022
Synx - A command-line tool that reorganizes your Xcode project folder to match your Xcode groups

A command-line tool that reorganizes your Xcode project folder to match your Xcode groups. Xcode Finder Installation $ gem install synx Usage Basic ⚠

Venmo 6.1k Jan 2, 2023
Swift-project-template - 🍪 Easily generate Swift projects with Cookiecutter

swift-project-template ?? Cookiecutter template for Swift iOS projects. Features: Xcode 11 and Swift 5.0 support AppCode support Custom project struct

Artem Novichkov 86 Jul 8, 2022
CodeEditTextView - An Xcode-inspired code editor view written in Swift powered by tree-sitter for CodeEdit

An Xcode-inspired code editor view written in Swift powered by tree-sitter for CodeEdit. Features include syntax highlighting (based

CodeEdit 243 Jan 8, 2023
Swift package to interact with Xcode Code Snippets in a type-safe manner

XCSnippets Swift package to provide type-safe interaction with (user-defined) Xcode Code Snippets Overview import XCSnippets let directory = Persiste

Marco Eidinger 4 Oct 11, 2022
Swift package to interact with Xcode Code Snippets in a type-safe manner

XCSnippets Swift package to provide type-safe interaction with (user-defined) Xcode Code Snippets Overview import XCSnippets let directory = Persiste

Marco Eidinger 3 Jun 24, 2022
XcodeCodeSnippets - Code snippets for Xcode.

XcodeCodeSnippets A set of snippets for Xcode. Requirements Xcode 7.3.1 or later. Installation To install or update the snippets you need: Quit Xcode

Ivan Smetanin 33 Oct 14, 2022
Xcode-developer-disk-image-all-platforms - A repo which shares all developer disk images for iOS, tvOS, watchOS

Disclaimer: The available resources and files from this repo are uploaded from many contributors. The files are unverified, untested, and could have n

Hai K 253 Dec 21, 2022
Awesome-swift-platforms - A curated list of Swift on different platforms

Embedded Swift A curated list of Swift on different platforms. Nintendo Switch S

Devran Cosmo Uenal 4 Feb 6, 2022
VIPERModuleTemplate - Template of VIPER Module for Xcode

Once you've decided to use a VIPER architecture in your app, you should know about the routine. For each screen/module you should create at least 6 fi

Bogdan Evsenev 17 Dec 10, 2021
LOL Champions app: a small Multi-Module demo application to demonstrate modern iOS application tech-stacks with a Multi-module and MVVM architecture

LOL Champions app: a small Multi-Module demo application to demonstrate modern iOS application tech-stacks with a Multi-module and MVVM architecture

Ahmed Nasser 5 Jun 9, 2022
ViperC - Xcode template for VIPER Architecture for both Objective-C and Swift.

ViperC Xcode template for VIPER Architecture for both Objective-C and Swift. ViperC creates modules for you when you want to use VIPER architecture in

Abdullah Selek 79 Nov 2, 2022
Challenge-viper-finance - Project for VIPER Architecture Dev Sprints on Devpass

VIPER Challenge - Finance App ?? Neste desafio, aplicaremos conceitos da arquite

Devpass 15 Oct 11, 2022
Use this template as a starting point for any Swift 5 module that you want other people to include in their projects

Swift 5 Module Template Use this template as a starting point for any Swift 5 mo

James Knipe 0 Dec 28, 2021
A Swift 4.2 VIPER Module Boilerplate Generator with predefined functions and a BaseViewProtocol.

Perfection is achieved, not when there is nothing more to add, but when there is nothing left to take away. Are you new to VIPER Design Pattern? Want

Mohamad Kaakati 68 Sep 29, 2022
LinkedLog is a Xcode plugin that includes a Xcode PCH header file template that adds the macros `LLog` and `LLogF` and parses their output to link from the console to the corresponding file and line.

LinkedLog Xcode Plugin LinkedLog is a Xcode plugin that includes a Xcode PCH file template that adds the macros LLog and LLogF. The LLog macro will wo

Julian F. Weinert 22 Nov 14, 2022
Simple memory game written in Swift 4 using VIPER Architecture.

Viper Memory Game Simple memory game written in Swift 4.2 using VIPER Architecture. The Memory Game is a deck of cards where the user needs to find ma

Mati 23 Jun 6, 2022
An iOS template project using SwiftUI, Combine and MVVM-C software architecture

SwiftUI-MVVM-C A template project that uses SwiftUI for UI, Combine for event handling, MVVM-C for software architecture. I have done some small proje

Huy Nguyen 107 Jan 2, 2023
Swift Interaction with VIPER Architecture

SwiftyVIPER SwiftyVIPER allows easy use of VIPER architecture throughout your iOS application. VIPER Architecture What is VIPER? Great question! VIPER

Cody Winton 121 Jan 2, 2023