ArchitecturalPatterns

Setup

  1. Go to folder ~/Library/Developer/Xcode/Templates/ and copy a chosen pattern
  2. If everything is correct, Xcode should have the template in the create new files window

Снимок экрана 2022-03-28 в 15 31 42

3. To create a module select the template

Снимок экрана 2022-03-28 в 15 38 42

Снимок экрана 2022-03-28 в 15 39 36

4. Point to the parent folder, right click and choose “Add files to “…”. (The template creates just a folder and not actually an Xcode group, so all the files inside the module are not members of the app target. Sadly, after some research, it seems that it is not currently possible to create a new group when you use a new file template, only when creating a template for a new project.)

Снимок экрана 2022-03-28 в 15 46 47

Снимок экрана 2022-03-28 в 15 47 02

5. The new group is created, and now the old folder of module can safely remove. Right click on , choose “Delete” and pick the option “Remove reference”.

Снимок экрана 2022-03-28 в 15 52 24

6. The new module is ready to be used!

Снимок экрана 2022-03-28 в 15 56 52

VIPER

Structure:

  • ModuleName
    • ModuleName.storyboard
    • View
      • ModuleNameViewController
    • Interactor
      • ModuleNameInteractor
    • Presenter
      • ModuleNamePresenter
    • Router
    • ModuleNameRouter
    • Protocols
      • ModuleNameProtocols
    • Configurator
      • ModuleNameConfigurator
      • ModuleNameConstants