Collection of Generamba VIPER templates.
- create Rambafile at the root of your project folder.
- add templates description to it (see below)
- setup all variables
- in 'Templates' section define all templates or only some them.
- open terminal in project folder
- install Generamba
- run:
generamba template install
- generamba will fetch required templates to "./Templates" folder
- now you can generate any new module using generamba:
generamba gen MyModuleName SwiftyViperMcFlurryAlert
- also you can pass additional keys to generamba (see keys supported by these templates):
generamba gen MyModuleName SwiftyViperMcFlurryAlert --custom_parameters extended_configure:true
- most of the templates requires additional pods installed, see concrete template description
tabbar
=SwiftyViperMcFlurryTabbar
service
=SwiftyViperService
default
=SwiftyViperMcFlurryStoryboard
alert
=SwiftyViperMcFlurryAlert
container
=SwiftyViperMcFlurryEmbedStoryboard
collection_as_root_and_cachetracker
=SwiftyViperMcFlurryStoryboardRootCollectionViewCacheTracker
collection_as_root_with_embeddables_and_cachetracker
=SwiftyViperMcFlurryStoryboardComplexRootCollectionViewCacheTracker
collection_as_secondary_and_cachetracker
=SwiftyViperMcFlurryStoryboardCollectionViewCacheTracker
collection_as_secondary_with_embeddables_and_cachetracker
=SwiftyViperMcFlurryStoryboardComplexCollectionViewCacheTracker
table_as_root_and_cachetracker
=SwiftyViperMcFlurryStoryboardRootTableViewCacheTracker
table_as_root_with_embeddables_and_cachetracker
=SwiftyViperMcFlurryStoryboardComplexRootTableViewCacheTracker
table_as_secondary_and_cachetracker
=SwiftyViperMcFlurryStoryboardTableViewCacheTracker
table_as_secondary_with_embeddables_and_cachetracker
=SwiftyViperMcFlurryStoryboardComplexTableViewCacheTracker
transparent
=SwiftyViperMcFlurryTrasparent
Most of the templates generate UI modules, but some of them generate lowe level logic modules: services. In project structure services code is located usually in different place than UI. So whil generation you should pass another path for new module location. This can be achieved by passed special keys to generamba:
- --module_path
- --test_path
generamba gen My service --module_path MyApp/Services
or if you use tests
generamba gen My service --module_path MyApp/Services --test_path MyAppTests/Services
More generamba info you can find at generamba commands
Keys passed with --custom_parameters to generamba.
generamba gen MyModuleName SwiftyViperMcFlurryAlert --custom_parameters key1:value1 key2:value2 ...
Usefull when configuration of module is not trivial. If passed as true:
generamba gen MyModuleName SwiftyViperMcFlurryAlert --custom_parameters extended_configure:true
then configure()
method of module input will be generated as:
struct MyModuleConfig {
// TODO: Place your code here
}
protocol MyModuleInput: AnyObject {
func configure(with config: MyModuleConfig)
}
In this case you can add more parameters while development to MyModuleConfig
without modifying existing code.
NOTE: Parameter make sense for templates where embeddable module used only (SwiftyViperMcFlurryStoryboardComplexRootTableViewCacheTracker, etc...).
If defined, then configuration method of embeddable module will generated with input object.
NOTE: Parameter make sense for SwiftyViperReduxService
only.
redux_service_state_vars:a=AClass,b=BClass?
will produce state variables for service as:
var a: AClass
var b: BClass?
NOTE: Parameter make sense for SwiftyViperReduxService
only.
Generates code for storing state of service to user defaults
NOTE: Parameter make sense for SwiftyViperReduxService
only.
Generates method usifull for observing changes of service in Rx way.
NOTE: Parameter make sense for SwiftyViperReduxService
only.
Will generate getters for state vars.
var a: AClass { get }
var b: BClass? { get }
NOTE: Parameter make sense for SwiftyViperReduxService
only.
Will generate setters for state vars. Usefull only if redux_service_generate_state_vars_getters:true
is defined.
var a: AClass { get set }
var b: BClass? { get set }
### Templates
templates:
- {name: default, git: 'https://github.com/ladeiko/SwiftyViperTemplates.git'}
- {name: container, git: 'https://github.com/ladeiko/SwiftyViperTemplates.git'}
- {name: tabbar, git: 'https://github.com/ladeiko/SwiftyViperTemplates.git'}
- {name: alert, git: 'https://github.com/ladeiko/SwiftyViperTemplates.git'}
- {name: transparent, git: 'https://github.com/ladeiko/SwiftyViperTemplates.git'}
- {name: table_as_root_and_cachetracker, git: 'https://github.com/ladeiko/SwiftyViperTemplates.git'}
- {name: table_as_root_with_embeddables_and_cachetracker, git: 'https://github.com/ladeiko/SwiftyViperTemplates.git'}
- {name: table_as_secondary_and_cachetracker, git: 'https://github.com/ladeiko/SwiftyViperTemplates.git'}
- {name: table_as_secondary_with_embeddables_and_cachetracker, git: 'https://github.com/ladeiko/SwiftyViperTemplates.git'}
- {name: collection_as_root_and_cachetracker, git: 'https://github.com/ladeiko/SwiftyViperTemplates.git'}
- {name: collection_as_root_with_embeddables_and_cachetracker, git: 'https://github.com/ladeiko/SwiftyViperTemplates.git'}
- {name: collection_as_secondary_and_cachetracker, git: 'https://github.com/ladeiko/SwiftyViperTemplates.git'}
- {name: collection_as_secondary_with_embeddables_and_cachetracker, git: 'https://github.com/ladeiko/SwiftyViperTemplates.git'}
- {name: service, git: 'https://github.com/ladeiko/SwiftyViperTemplates.git'}
- {name: redux_service, git: 'https://github.com/ladeiko/SwiftyViperTemplates.git'}
Template for generating viper service using ViperServices module
Simple viper module where UIViewController is not associated with any XIB/Storyboard file.
Simple viper module where UIViewController is associated with XIB file (which one is also generated).
Simple viper module where UIViewController is associated with Storyboard file (which one is also generated).
Similar to SwiftyViper, but also generates code which helps to use ViperMcFlurryX module in router.
Creates module implementing UIAlertController in alert mode using VIPER paradigm.
Creates module with main transparent view presented immediatly event if animation was specified. You can use it to present some other native Apple controller over transparent view. Similar trick is used in SwiftyViperMcFlurryAlert template.
Similar to SwiftyViperXib, but also generates code which helps to use ViperMcFlurryX module in router.
Similar to SwiftyViperStoryboard, but also generates code which helps to use ViperMcFlurryX module in router.
Similar to SwiftyViperMcFlurryStoryboard, but also generates code to embed another module to current view via storyboard. This can be usefull when you compose module onto some container module. Later you can manually add more containers and embed more modules.
Creates module with UICollectionView as secondary view placed onto main controller view. Also it creates start code to show items stored in database using CacheTracker and CacheTrackerConsumer in plain (no sections) mode.
Creates module with UICollectionView as main view of controller (UICollectionViewController). Also it creates start code to show items stored in database using CacheTracker and CacheTrackerConsumer in plain (no sections) mode.
Creates module with UITableView as secondary view placed onto main controller view. Also it creates start code to show items stored in database using CacheTracker and CacheTrackerConsumer in plain (no sections) mode.
Creates module with UITableView as main view of controller (UITableViewController). Also it creates start code to show items stored in database using CacheTracker and CacheTrackerConsumer in plain (no sections) mode.
This project is licensed under the MIT License - see the LICENSE file for details