Git Product home page Git Product logo

swift-mvcgen's Introduction

MVC Module Generator

โš ๏ธ This project is currently on development and it must be used before project starts, otherwise it will override some of your files.

Gem to generate MVC starting modules to use them in your Swift projects The implementation scheme returned by this generator is hardly inspired in the example and post of vipergen, https://rubygems.org/gems/vipergen/versions/0.2.6 .

Features

MVC files structure

.swift
+-- Helper
|   +-- Utils.swift
|   +-- AWSManager.swift
|   +-- FilesManager.swift
|   +-- APIManager.swift
|   +-- APIRequestBody.swift
|   +-- S3Manager.swift
|   +-- APIHelper.swift
+-- Controllers
|   +-- Login
|   |   +-- LoginVC.swift
|   |   +-- RegisterVC.swift
|   |   +-- ForgetPasswordVC.swift
|   +-- Notifications
|   |   +-- NotificationsVC.swift
|   |   +-- Cells
|   |   |   +-- NotificationsCell.swift
|   +-- Profile
|   |   +-- ProfileContainerVC.swift
|   |   +-- AboutUsVC.swift
|   |   +-- ProfileTVC.swift
|   |   +-- Cells
|   |   |   +-- ImagesCollectionViewCell.swift
|   |   |   +-- DescriptionCell.swift
|   |   |   +-- DestinationCellView.xib
|   |   |   +-- DestinationCell.swift
|   |   |   +-- FavoriteCollectionCell.swift
|   |   |   +-- AboutUsImageCell.swift
|   +-- OtherLogin
|   |   +-- SelectLanguageCell.swift
|   |   +-- OtherRegisterVC.swift
|   |   +-- ForgetPasswordTVC.swift
|   |   +-- LoginTVC.swift
|   |   +-- SelectLanguageVC.swift
|   |   +-- TermsAndConditionsVC.swift
|   +-- Tutorial
|   |   +-- TutorialVC.swift
+-- Extensions
|   +-- Buttons.swift
|   +-- CustomCamera.swift
|   +-- UnderlinedWithIconTextField.swift
|   +-- UnderlinedTextView.swift
|   +-- Utils+Array.swift
|   +-- Utils+Images.swift
|   +-- Utils+String.swift
|   +-- Utils+UIButton.swift
|   +-- Utils+UIColor.swift
|   +-- Utils+UITableView.swift
|   +-- Utils+UITextField.swift
|   +-- Utils+UIView.swift
|   +-- Utils+UIViewController.swift
+-- Models
|   +-- Notif.swift
|   +-- Country.swift
|   +-- User.swift
|   +-- Responeses
|   |   +-- UserResponse.swift
|   |   +-- NotificationResponse.swift
|   |   +-- BaseResponse.swift
|   |   +-- UserSingupResponse.swift
|   +-- Managers
|   |   +-- UserManager.swift
+-- Config
|   +-- Config.plist
|   +-- Config.swift
+-- UI
|   +-- Views
|   |   +-- EmptyTableView
|   |   |   +-- EmptyTableLabelView.swift
|   |   |   +-- NoNotificationView.swift
|   |   |   +-- Xibs
|   |   |   |   +-- EmptyTableLabelView.xib
|   |   |   |   +-- NoNotificationsView.xib
|   +-- Storyboards
|   |   +-- Login.storyboard
|   |   +-- OtherLogin.storyboard
|   |   +-- Home.storyboard
+-- Info.plist
+-- Assets.xcassets
+-- AppDelegate.swift
.podfile
+-- Podfile
|   +-- podfile

How to install mvcgen ?

You can install it easily as using the gem. With ruby installed in your OSX execute:

sudo gem install mvcgen

If everything were right, you should have now the mvcgen command available in your system console

How to generate a MVC module with a given name?

You have just to execute the following command standing on your project root folder

mvcgen generate YourProjectName --path=./

And then the files structure will be automatically created and added to the project. Don't forget to run pod install after that

Developer tips

Update the gem

When the gem is updated it has to be reported to the gem repository. I followed this tutorial http://amaras-tech.co.uk/article/43/Creating_executable_gems that basically says that once you have your gem ready execute:

gem build mvcgen.gemspec
gem install mvcgen-0.1.gem
gem push mvcgen-0.1.gem

Then you'll be asked for your credentials in order to make the update in the repo (http://guides.rubygems.org/publishing/)

To remove previous gem versions:

gem cleanup mvcgen

Add a new template

Are you interested in this project and you would like to contribute by adding new templates? Feel free to do it. It's pretty easy. You've just to:

  • Create a folder inside templates with the name of your template
  • You'll have to create inside the templates a swift folder with your files (get inspired from existing templates)
  • Use the word MVCGEN where you want the name to be replaced in.
  • Remember to add the file mvcspec.yml with the description of your template as below:
author: pepito
author_email: [email protected]
template_description: Default template with..
updated_at: 2018-08-01
  • Report it as a PR in this repo updating the gem version in Gemspec.

Resources

swift-mvcgen's People

Contributors

hk-danielmartinez avatar diegomazzone avatar danielmartinezc avatar

Recommend Projects

  • React photo React

    A declarative, efficient, and flexible JavaScript library for building user interfaces.

  • Vue.js photo Vue.js

    ๐Ÿ–– Vue.js is a progressive, incrementally-adoptable JavaScript framework for building UI on the web.

  • Typescript photo Typescript

    TypeScript is a superset of JavaScript that compiles to clean JavaScript output.

  • TensorFlow photo TensorFlow

    An Open Source Machine Learning Framework for Everyone

  • Django photo Django

    The Web framework for perfectionists with deadlines.

  • D3 photo D3

    Bring data to life with SVG, Canvas and HTML. ๐Ÿ“Š๐Ÿ“ˆ๐ŸŽ‰

Recommend Topics

  • javascript

    JavaScript (JS) is a lightweight interpreted programming language with first-class functions.

  • web

    Some thing interesting about web. New door for the world.

  • server

    A server is a program made to process requests and deliver data to clients.

  • Machine learning

    Machine learning is a way of modeling and interpreting data that allows a piece of software to respond intelligently.

  • Game

    Some thing interesting about game, make everyone happy.

Recommend Org

  • Facebook photo Facebook

    We are working to build community through open source technology. NB: members must have two-factor auth.

  • Microsoft photo Microsoft

    Open source projects and samples from Microsoft.

  • Google photo Google

    Google โค๏ธ Open Source for everyone.

  • D3 photo D3

    Data-Driven Documents codes.