Swift-project-template - ๐Ÿช Easily generate Swift projects with Cookiecutter

Overview

swift-project-template

Build Status

๐Ÿช Cookiecutter template for Swift iOS projects.

swift-project-template

Features:

  • Xcode 11 and Swift 5.0 support
  • AppCode support
  • Custom project structure (the same in the project and on the disk)
  • Configurations and schemes:

swift-project-template

  • Custom scripts for Carthage and SwiftLint
  • iOS Deployment Target - 12.0
  • Optional integrations:
  • Template for Github pull requests
  • Settings.bundle with app version
  • Disabled automatic code signing (sorry, Apple ๐Ÿคทโ€โ™‚๏ธ )
  • -Xfrontend -debug-time-function-bodies flags for profiling compilation times
  • .gitattributes for correct repo language detection via linguist

Usage

  1. Install Cookiecutter:

    brew install cookiecutter

  2. Run cookiecutter gh:artemnovichkov/swift-project-template. No need to create project folder manually, cookiecutter does it for you.

For future runs you can shorten the command to cookiecutter swift-project-template. However, if you want to use the most recent template you should still run the full command above. Or just create an alias:

alias template="cookiecutter gh:artemnovichkov/swift-project-template"

Author

Artem Novichkov, [email protected]

License

swift-project-template is available under the MIT license. See the LICENSE file for more info.

Comments
  • Add project name to scheme names

    Add project name to scheme names

    There are some schemes with names like "Adhoc Debug" or "AppStore". The names are used for archive names. Please append a project name, for example, "MyProject AppStore".

    enhancement hacktoberfest 
    opened by artemnovichkov 9
  • Created project doesn't build in AppCode

    Created project doesn't build in AppCode

    Just create project via this template and try to build it on simulator in AppCode. Build will be failed. After small investigations I found out that fail happens because of

    The following build commands failed:
    	Check dependencies
    
    bug 
    opened by Antowkos 5
  • Create a project and script for template updating

    Create a project and script for template updating

    It's hard to update the template. I have to create a new project, make needed changes and copy diffs to the template. I want to create a base project and a Swift script, for example https://github.com/Raizlabs/ios-template.

    enhancement hacktoberfest 
    opened by artemnovichkov 3
  • Carthage is an undocumented dependency

    Carthage is an undocumented dependency

    Running cookiecutter failed for me:

    Initialized empty Git repository in ...
    /var/folders/yd/38lbvn4x4d52x1jxtk2q5lf40000gn/T/tmpHfaQHP.sh: line 6: carthage: command not found
    ERROR: Stopping generation because post_gen_project hook script didn't exit successfully
    Hook script failed (exit status: 127)
    

    Resolved by running brew install carthage.

    opened by caipre 2
  • Add DEBUG and ADHOC flags

    Add DEBUG and ADHOC flags

    Sometimes it's needed to add logic for all debug schemes, for instance:

    #if DEBUG || ADHOC
    
            let fingerTipWindow = MBFingerTipWindow(frame: UIScreen.main.bounds)
            fingerTipWindow.alwaysShowTouches = UserDefaults.standard.isFingertipsEnabled
            window = fingerTipWindow
            Deboogger.configure(with: MeasurementPlugin(), HeightPlugin(), WeightPlugin(), FingertipsPlugin())
    
            #else
    
            window = UIWindow(frame: UIScreen.main.bounds)
    
            #endif
    

    I would like to add common flags for those scheme types.

    enhancement 
    opened by artemnovichkov 1
  • Bootstrap

    Bootstrap

    Add Makefile and scripts to simplify steps during initializing and bootstrapping:

    • Check required dependencies
    • Using Fastfood to add last fastlane lanes from RSBFastlane
    • Uncomment correct flags from fastlane/.env
    opened by artemnovichkov 0
  • Update Swiftlint

    Update Swiftlint

    Add Swiftlint rules:

    type_contents_order:
      order:
        - case
        - associated_type
        - type_alias
        - subtype
        - [type_property, instance_property]
        - [initializer, type_method, view_life_cycle_method, subscript, other_method, ib_action]
    
    file_header:
      required_pattern: |
                        \/\/
                        \/\/  Copyright ยฉ \d{4}\ .*?. All rights reserved.
                        \/\/
    
    opened by artemnovichkov 0
  • Add Build Phase script for SwiftGen

    Add Build Phase script for SwiftGen

    Something like that:

    if [ -f "$SRCROOT"/Resources/Assets.swift ]; then
        chmod +w "$SRCROOT"/Resources/Assets.swift
    fi
    if [ -f "$SRCROOT"/Resources/Strings.swift ]; then
        chmod +w "$SRCROOT"/Resources/Strings.swiftt
    fi
    swiftgen
    chmod -w "$SRCROOT"/Resources/Assets.swift
    chmod -w "$SRCROOT"/Resources/Strings.swift
    

    Add it before Compile Sources phase to check errors during builds. Don;t forget to check use_swiftgen flag.

    enhancement 
    opened by artemnovichkov 0
  • Fix `accessors_and_observers_on_newline` swiftlint rule

    Fix `accessors_and_observers_on_newline` swiftlint rule

    Fixed wrong triggering of accessors_and_observers_on_newline SwiftLint rule.

    Rule is no longer triggering for following code:

    settingsButton.configureFrame { maker in
        maker.center()
    }
    

    Regex tested here.

    opened by nzatsepilov 0
  • Add support of Xcode 9.x

    Add support of Xcode 9.x

    Xcode 9.3 breaks Codable inits. I have an idea of supporting multiple versions of Xcode. My suggestion is to support all minor versions of current and previous major versions, for instance, 8.x-9.x. It's available via --checkout flag with name of branch:

    cookiecutter gh:artemnovichkov/swift-project-template --checkout xcode-9.3
    
    enhancement 
    opened by artemnovichkov 0
Owner
Artem Novichkov
Bearded iOS developer from Siberia ๐Ÿ‘จ๐Ÿปโ€๐Ÿ’ป
Artem Novichkov
ViperC - Xcode template for VIPER Architecture for both Objective-C and Swift.

ViperC Xcode template for VIPER Architecture for both Objective-C and Swift. ViperC creates modules for you when you want to use VIPER architecture in

Abdullah Selek 79 Nov 2, 2022
VIPERModuleTemplate - Template of VIPER Module for Xcode

Once you've decided to use a VIPER architecture in your app, you should know about the routine. For each screen/module you should create at least 6 fi

Bogdan Evsenev 17 Dec 10, 2021
Synx - A command-line tool that reorganizes your Xcode project folder to match your Xcode groups

A command-line tool that reorganizes your Xcode project folder to match your Xcode groups. Xcode Finder Installation $ gem install synx Usage Basic โš 

Venmo 6.1k Jan 2, 2023
Awesome-swift-platforms - A curated list of Swift on different platforms

Embedded Swift A curated list of Swift on different platforms. Nintendo Switch S

Devran Cosmo Uenal 4 Feb 6, 2022
Swift package to interact with Xcode Code Snippets in a type-safe manner

XCSnippets Swift package to provide type-safe interaction with (user-defined) Xcode Code Snippets Overview import XCSnippets let directory = Persiste

Marco Eidinger 4 Oct 11, 2022
CodeEditTextView - An Xcode-inspired code editor view written in Swift powered by tree-sitter for CodeEdit

An Xcode-inspired code editor view written in Swift powered by tree-sitter for CodeEdit. Features include syntax highlighting (based

CodeEdit 243 Jan 8, 2023
Swift package to interact with Xcode Code Snippets in a type-safe manner

XCSnippets Swift package to provide type-safe interaction with (user-defined) Xcode Code Snippets Overview import XCSnippets let directory = Persiste

Marco Eidinger 3 Jun 24, 2022
Easily generate cross platform Swift framework projects from the command line

SwiftPlate Easily generate cross platform Swift framework projects from the command line. SwiftPlate will generate Xcode projects for you in seconds,

John Sundell 1.8k Dec 27, 2022
Use this template as a starting point for any Swift 5 module that you want other people to include in their projects

Swift 5 Module Template Use this template as a starting point for any Swift 5 mo

James Knipe 0 Dec 28, 2021
SwiftUITemplate - Template repository for SwiftUI projects

SwiftUITemplate Template repository for SwiftUI projects. Environment Name Versi

y-okudera 2 Jul 10, 2022
Swift tool to generate Module Interfaces for Swift projects.

ModuleInterface Swift tool to generate Module Interfaces for Swift projects. What is a Module Interface A Module Interface is what we commonly get usi

Jorge Revuelta 75 Dec 21, 2022
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.

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.

null 8.3k Jan 5, 2023
SwiftGen is a tool to automatically generate Swift code for resources of your projects

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

null 8.3k Jan 5, 2023
A tool that generate code for Swift projects, designed to improve the maintainability of UIColors

SwiftColorGen A tool that generate code for Swift projects, designed to improve the maintainability of UIColors. Please notice, this tool still under

Fernando del Rio 150 Oct 23, 2022
This repository contains rules for Bazel that can be used to generate Xcode projects

rules_xcodeproj This repository contains rules for Bazel that can be used to generate Xcode projects. If you run into any problems with these rules, p

BuildBuddy 233 Dec 28, 2022
Don't start from scratch, start from Here! This is a starter project for iOS projects. It contains all the basic configurations and common libraries for your project.

Starter-iOS Don't start from scratch, start from Here! This is a starter project for iOS projects. It contains all the basic configurations and common

Shaban Kamel 6 May 24, 2022
UIKit-based app project template for Swift Playgrounds 4

playgrounds-uikit-app This is a simplistic sample template for Swift Playgrounds 4 to begin with a UIKit-based app delegate & window scene instead of

Steven Troughton-Smith 39 Sep 19, 2022
A template for new Swift iOS / macOS / tvOS / watchOS Framework project ready with travis-ci, cocoapods, Carthage, SwiftPM and a Readme file

Swift Framework Template A template for new Swift Framework. What's in the template? Deployment Targets - iOS 9.0 / Mac OS X 10.10 / tvOS 9.0 / watchO

Rahul Katariya 529 Jun 27, 2022
iOS project template with fastlane lanes, Travis CI jobs and GitHub integrations of Codecov, HoundCI for SwiftLint and Danger

iOS project template This repository contains a template for iOS projects with a framework-oriented architecture approach, preconfigured fastlane lane

Sebastian Messingfeld 390 Nov 9, 2022
Tuist based iOS Application Project Template

iOSApplicationTemplate ์ด ํ”„๋กœ์ ํŠธ๋Š” Tuist๋ฅผ ์ด์šฉํ•˜์—ฌ ๊ฐ ํ”„๋กœ์ ํŠธ๋ฅผ ๋ชจ๋“ˆ๋กœ ๊ตฌ์„ฑํ•˜๋Š” ํ˜•ํƒœ์ž…๋‹ˆ๋‹ค. ์‚ฌ์šฉ๋ฒ• Tuist ์„ค์น˜ - ๋ฒ„์ „ 1.43.0 ์ด์ƒ Carthage ์„ค์น˜ - ๋ฒ„์ „ 0.38.0 ์ด์ƒ tuist dependencies๋ฅผ ์‹คํ–‰ํ•˜์—ฌ XCF

Ahn Jung Min 102 Dec 20, 2022