Skip to content

Instantly share code, notes, and snippets.

@diamantidis
Last active June 28, 2022 12:47
Show Gist options
  • Star 3 You must be signed in to star a gist
  • Fork 0 You must be signed in to fork a gist
  • Save diamantidis/be9f31b35d301fa97c5f3531adde86c3 to your computer and use it in GitHub Desktop.
Save diamantidis/be9f31b35d301fa97c5f3531adde86c3 to your computer and use it in GitHub Desktop.
A custom Xcode Template with coordinator
//___FILEHEADER___
import Foundation
class ___FILEBASENAMEASIDENTIFIER___ {
func start() {
}
private lazy var viewModel: ___VARIABLE_productName:identifier___ViewModel = {
let vm = ___VARIABLE_productName:identifier___ViewModel()
return vm
}()
private lazy var viewController: ___VARIABLE_productName:identifier___ViewController = {
let vc = ___VARIABLE_productName:identifier___ViewController(with: viewModel)
return vc
}()
}
//___FILEHEADER___
import UIKit
class ___FILEBASENAMEASIDENTIFIER___: UIViewController {
init(with viewModel: ___VARIABLE_productName:identifier___ViewModel) {
self.viewModel = viewModel
super.init(nibName: nil, bundle: nil)
}
@available(*, unavailable)
required init?(coder aDecoder: NSCoder) {
fatalError("init(coder:) has not been implemented")
}
override func viewDidLoad() {
super.viewDidLoad()
// Do any additional setup after loading the view.
}
private let viewModel: ___VARIABLE_productName:identifier___ViewModel
}
//___FILEHEADER___
import Foundation
struct ___FILEBASENAMEASIDENTIFIER___{
}
{
Kind = "Xcode.IDEFoundation.TextSubstitutionFileTemplateKind";
Platforms = (
"com.apple.platform.iphoneos",
);
Options = (
{
Description = "The name of the module to create";
Identifier = "productName";
Name = "New Module Name:";
Required = YES;
Type = text;
}
);
}
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment