lucianomarisi / XcodeFileTemplates

Geek Repo:Geek Repo

Github PK Tool:Github PK Tool

Xcode File Templates

Useful Xcode file templates for day to day use.

Available templates

  • [Swift Test File](Swift Test File.xctemplate/XCTestCaseTabs/FILEBASENAME.swift) containing:

    • import XCTest
    • @testable import <project_name>
    • Empty setUp and tearDown methods
    • Choose between tabs or spaces
  • [Swift Nimble Test file](Swift Nimble Test File.xctemplate/XCTestCaseTabs/FILEBASENAME.swift) containing all of Swift Test File and:

  • [Swift Snapshot Test file](Swift Snapshot Test File.xctemplate/XCTestCaseTabs/FILEBASENAME.swift) containing all of Swift Test File and:

    • An import for FBSnapshotTestCase
    • Test class inherits from FBSnapshotTestCase
    • setUp include recordMode = true

Installation

  1. Download/clone the repository

  2. Create the templates directory if your don't have it:

    mkdir -p ~/Library/Developer/Xcode/Templates/File\ Templates/Source

  3. Moved the templates (.xctemplate folders) you find useful to the templates directory, for example:

    cp -r Swift\ Test\ File.xctemplate ~/Library/Developer/Xcode/Templates/File\ Templates/Source

About