Swift MVVM

Generates swift templates using MVVM (model view view model) design pattern


License
MIT

Documentation

Swift MVVM Template

Swift MVVM is an Xcode File Template for Generating minimum required files to create a module with MVVM model in Swift. When the template is installed, it will create a View Controller, View Manager, Logic Manager, View Nib hooked up with View Manager and View Model to follow the standard Model-View-ViewModel (MVVM in Swift) design pattern.

Install

If you are using Alcatraz, you should be able to download it from there.

If you aren't using Alcatraz, just type the commands below in terminal.

$ git clone https://github.com/freesuraj/SwiftTemplate.git
$ cd Swift MVVM
$ ./install-templates.sh

If you got a permission denied error while executing the script file, give it an execution permission.

$ sudo chmod 755 install-templates.sh
  • Using Node.js

Alternatively, if you want to create the templates without relying on Xcode, you can do so by using following commands

$ git clone https://github.com/freesuraj/SwiftTemplate.git
$ cd node
$ npm install
$ node app.js -c ModuleName -d Directory/To/Save

Uninstall

$ ./uninstall-templates.sh

If you got a permission denied error while executing the script file, give it an execution permission.

$ sudo chmod 755 uninstall-templates.sh

Usage

  • After you've installed the template in Xcode, restart the Xcode. In your Xcode project, when you create a new file, you can select Swift MVVM as follows. ScreenShot