ivfomenko / Xcode-File-Templates

Xcode File Templates for automatic files creation

Geek Repo:Geek Repo

Github PK Tool:Github PK Tool

Xcode File Templates

Xcode File Templates for automatic files creation

Templates Contains:

MVVM

SwiftUI

UIKit

VIPER

Domain Layer

Unit Tests

Quick & Nimble

XCTest

Tools:

Extensions

Install:

Default install

Only need execute next commands in terminal:

cd ~/Downloads
git clone https://github.com/coreteka-service/iOS-Templates
cd Xcode-File-Templates
sh ./install.sh -a
cd ..
rm -rf Xcode-File-Templates

You should see one of such kind of output message:

✅ All templates installed to : ~/Library/Developer/Xcode/Templates/Project Templates/ 

Advanced install

If you interested in special templates, you can use options for script:

Install all templates:

sh ./install.sh -a

Install Extensions templates:

sh ./install.sh -e

Install Tests templates:

sh ./install.sh -t

Install Tools templates:

sh ./install.sh -o

Install MVVM templates:

sh ./install.sh -m

Install Viper templates:

sh ./install.sh -v

Note: You can combine several options. But keep in mind, in case of -a usage, script will install all teamplates and exit from execution no matter to other options.

Manual | With Saving Folder structure

  1. Open folder Templates/File Template from downloaded or cloned repository.
  2. Go to direction ~/Library/Developer/Xcode/ and set folders with templates
  3. If direction ~/Library/Developer/Xcode/ already has folder Templates and File Templates, just use the following folders and paste it into File Templates folder.

Usage:

- CMD+N //  and select needed Template 
- New -> File -> //  and select needed

Xcode Templates Requirements:

For comfortable use of all templates, it is recommended to install the following dependencies in your projects:

Mandatory:

  • Nimble / Use Nimble to express the expected outcomes of Swift or Objective-C expressions
  • Quick / Quick is a behavior-driven development framework for Swift and Objective-C

Optional

  • Moya / Network abstraction layer written in Swift
  • Swinject / Dependency injection framework for Swift with iOS/macOS/Linux
  • RxSwift / Reactive Programming in Swift
  • Realm / Realm is a mobile database: a replacement for Core Data & SQLite

Project setup Templates

General

For starting new project you mandatory need to create all files from CommonServices folder.

Automatically localization tools

Repository containt folder lang_exports. This Folder containt 3 scripts for automatic work with localizaiton files.

genstring.swift

Script will get all strings with extensions .localize from project and add them into localization files (.strings files for all avaialble localizations). If keys is exist in .strings file, should not add it. For run:

cd <project_root_folder>
cd lang_export
swift genstring.swift

export-text.py

Script will parse .strings files and generate .xlsx (lang.xlsx file will be output) file with keys and their values for all avaialable language For run:

cd <project_root_folder>
cd lang_export
python3 export-text.py // or python export-text.py

import-text.py

Script will parse input lang.xlsx file and update keys and their values in .string files for all avaialble langugages

lang.xlsx must be in one folder with import-text.py file

For run:

cd <project_root_folder>
cd lang_export
python3 import-text.py // or python import-text.py

SwiftGen

SwiftGen is a tool to automatically generate Swift code for resources of your projects (like images, localised strings, etc), to make them type-safe to use.

Setup guide: https://github.com/SwiftGen/SwiftGen#installation

SonarQube

Setup your Sonar Qube project in your CI and inject config file named sonar-project.properties to the root folder of your project. Edit it according to your project needs.

Swiftlint

Setup swiftlint in your project by guide: https://github.com/realm/SwiftLint#installation. Finish configuration of your swiftlint settings by injecting .swiftlint.yml file into root folder of your project. Edit it according to your project needs.

Periphery

A tool to identify unused code in Swift projects. Setup periphery in your project by guide: https://github.com/peripheryapp/periphery#installation. Finish configuration of periphery by inject file named .periphery.yml to the root folder of your project. Edit it according to your project needs.

About

Xcode File Templates for automatic files creation


Languages

Language:Swift 74.4%Language:Python 11.0%Language:Ruby 8.3%Language:Shell 6.3%