Skip to content

A bench of Xcode Templates used in all Atelier Socle projects

License

Notifications You must be signed in to change notification settings

atelier-socle/xcode-templates

Folders and files

NameName
Last commit message
Last commit date

Latest commit

 

History

14 Commits
 
 
 
 
 
 
 
 
 
 
 
 
 
 

Repository files navigation

XcodeTemplates

XcodeTemplates is the starting point of (almost) every new file created in Xcode by Atelier Socle. Each time we create a new file (either for test or new screen or business code), we always start by the same thing: cleaning Xcode default template, adding our coding style, etc. Starting now, we said stop to these steps, so we created our own templates.

AS Templates

Intallation

To install the AS Templates, run in your terminal:

make or make install_templates

To uninstall them, run in your terminal:

make uninstall_templates

Templates

You'll find below a full list of all the templates available with a brief description of which one.

Scenes Templates

This template will generate a full VIPER scene, it will create: a Builder, an UIViewController, a Presenter, an Interactor, a Router, a ViewModel, and all the related protocols. We won't explain what is a VIPER architecture, or how it works, but you can find more information about it here.

Note: This templates comes with a demo using an UITableView, from here, it's your job to remove what you won't need, and adapt the output to your need.

Note 2: This template is using SwiftGen, if you are not, you will have to change how to instantiate the UIViewController.

This template will generate all the files necessary to cover all the tests from the VIPER Scene UIKit template. If you generate both of them, you'll see that it will compile without any changes, and have a 100% test coverage.

This template will generate a full MVVM scene, it will create: an UIViewController, a ViewModel, and all the related protocols. We won't explain what is a MVVM architecture, or how it works, but you can find a lot of articles talking about it.

Note: This templates comes with a demo using an UITableView, from here, it's your job to remove what you won't need, and adapt the output to your need.

Note 2: This template is using SwiftGen, if you are not, you will have to change how to instantiate the UIViewController.

This template will generate all the files necessary to cover all the tests from the MVVM Scene UIKit template. If you generate both of them, you'll see that it will compile without any changes, and have a 100% test coverage.

SwiftUI is still young, but we tried to find what will be a clean architecture for this framework. We ended with a light VIPER architecture composed of: a Builder, a View, a Presenter, an Interactor, a ViewModel, but which the who does what is quite different. We won't explain it here, but you are welcome to play with it and tell us what do you think about it or how to improve it.

This template will generate all the files necessary to cover all the tests from the Scene SwiftUI template. If you generate both of them, you'll see that it will compile without any changes.

Note: we didn't find an effective way to test the View yet, any ideas are welcomed!

UIKit Templates

  • UITableViewCell. This template will generate an UITableViewCell, with its xib, and delegate. The generated UITableviewCell is using Reusable to handle all the register/dequeue cell part.
  • UITableViewCellTests: This template will generate all the files necessary to cover all the tests from the template UITableViewCell.

Business Templates

  • Model: This template will generate a model supporting by default Decodable and Equatable.
  • ModelTests: This template will generate a model to cover all the tests from the Model template.

Contributions

Pull requests and issues are always welcome. Please open any issues and PRs for bugs, features, or documentation. Note that we keep the right to reject any PRs that we don't feel to integrate in future Atelier Socle project.

License

XcodeTemplates is licensed under the MIT license. See LICENSE for more info.