XCode Templates written with Swift 5

Swift Platforms Platforms SwiftLint Join the chat at https://gitter.im/XCode-Templates/XCode_Templates

XCode Templates was created to save time for iOS/MacOS developers that are usually spending time copy-pasting same code from another projects just to create new screen with simple UI elements. With XCode Templates this process can be significantly automated.

It automatically creates MVP components for a new screen: programmatical view, view controller, helpers, services, extension, models, etc.

The main idea is to create All-in-One solution where developer will be able to select template, UI framework (UIKit/SwiftUI) and select needed architecture (MVC/MVP/MVVM/VIPER). In every template I’m using only programmatical view, no xib/storyboard.

Feel free to leave your wishes and comments.

How to start using

  • Create “Templates” directory

      $ mkdir ~/Library/Developer/Xcode/Templates
  • Open “Templates” directory that you just created

      $ cd ~/Library/Developer/Xcode/Templates
  • Clone repository

      $ git clone https://github.com/mihail-konoplitskyi/4KSOFT-XCode-Templates.git
  • Restart XCode if it was opened

  • Open XCode project, press CMD+N, scroll down to 4KSOFT-XCode-Templates and use needed template

    How to select template

  • Add newly created module to a project

    Copy module

    Copy module 2

  • Remove module reference from a project (remove reference, not a directory)

    Remove reference

  • Highly recommend to use SwiftLint in your project using .swiftlint.yml which was used to create templates

  • Templates are using different third-party frameworks. You can find installation guide below:

    • SnapKit (DSL to make Auto Layout easy on both iOS and OS X)


Empty View Controller

Empty View Controller Screenshot

Table View

Custom Table View Cell

Collection View

Collection View

Carousel Collection View

Carousel Collection View

Paging Scroll View

Paging Scroll View

Projects built with XCode Templates

Future plans

All iOS/MacOS developers are spending tons of time doing absolutely identical work. This repository was created to solve this problem. In a close future I will create most recent templates for developers needs.

After most recent templates will be created with UIKit, I’ll start preparing AppKit templates for MacOS and SwiftUI templates.


View Github