Giter Site home page Giter Site logo

fulldecent / swift5-module-template Goto Github PK

View Code? Open in Web Editor NEW
447.0 14.0 55.0 330 KB

An opinionated starting point for awesome, reusable Swift 5 modules

License: MIT License

Ruby 21.68% Swift 78.32%
swift cocoapods ios template xcode swift-package-manager

swift5-module-template's Introduction

Swift 5 Module Template

Use this template as a starting point for any Swift 5 module that you want other people to include in their projects.

STATUS: This template is ready and works in production code, compatible with Xcode 15.2 (15C500b)

Swift 5 Module directory layout

Features

Your new Swift 5 module will immediately have working, compilable code, and implement these best practices:

  • Ability to be used from Swift Package Manager
  • Clean folder structure
  • MIT license
  • Testing as a standard
  • Turnkey access to GitHub Actions testing
  • Semantic versioning and a CHANGELOG
  • Included example/demo app using SwiftUI
  • Use a Xcode project to manage your code

How to use this

Clone or download a release and run the ./configure.rb program. It will ask you some questions and generate a project.

You then add all the interesting features you want your module to have.

Automating the configure script

To skip interactive prompts in the ./configure script, use these environment variables:

Template variable Environment variable
__PROJECT_NAME__ SMT_PROJECT_NAME
__ORGANIZATION NAME__ SMT_ORGANIZATION_NAME
com.AN.ORGANIZATION.IDENTIFIER SMT_COM_AN_ORGANIZATION_IDENTIFIER
__AUTHOR NAME__ SMT_AUTHOR_NAME
__TODAYS_DATE__ SMT_TODAYS_DATE
__TODAYS_DATE__ (date format) SMT_DATE_FORMAT_STRING Note: this will ask you for today’s date but it will use this format in the template.
__TODAYS_YEAR__ SMT_TODAYS_YEAR
__GITHUB_USERNAME__ SMT_GITHUB_USERNAME

For example, you may use: export SMT_ORGANIZATION_NAME='Awesome Org' before running ./configure.

How it works

graph LR
    subgraph Contributors to this project
    X[Use Xcode] --> R[Update Recipe.md]
    R --> T[Update template]
    end
    T --> C
    subgraph End users of this project
    C[Run ./configure.rb] --> M[Use your own module]
    end
Loading

Contributing

See the file Recipe.md for the complete steps (e.g. Open Xcode, make new project, click here, type that, …) of how we made the template.

Recommend Projects

  • React photo React

    A declarative, efficient, and flexible JavaScript library for building user interfaces.

  • Vue.js photo Vue.js

    🖖 Vue.js is a progressive, incrementally-adoptable JavaScript framework for building UI on the web.

  • Typescript photo Typescript

    TypeScript is a superset of JavaScript that compiles to clean JavaScript output.

  • TensorFlow photo TensorFlow

    An Open Source Machine Learning Framework for Everyone

  • Django photo Django

    The Web framework for perfectionists with deadlines.

  • D3 photo D3

    Bring data to life with SVG, Canvas and HTML. 📊📈🎉

Recommend Topics

  • javascript

    JavaScript (JS) is a lightweight interpreted programming language with first-class functions.

  • web

    Some thing interesting about web. New door for the world.

  • server

    A server is a program made to process requests and deliver data to clients.

  • Machine learning

    Machine learning is a way of modeling and interpreting data that allows a piece of software to respond intelligently.

  • Game

    Some thing interesting about game, make everyone happy.

Recommend Org

  • Facebook photo Facebook

    We are working to build community through open source technology. NB: members must have two-factor auth.

  • Microsoft photo Microsoft

    Open source projects and samples from Microsoft.

  • Google photo Google

    Google ❤️ Open Source for everyone.

  • D3 photo D3

    Data-Driven Documents codes.