SwiftKit

SwiftKit enables you to easily generate a cross platform Swift Framework from your command line.

It is the best way to start your next Open-Source Swift Framework.
SwiftKit is inspired by SwiftPlate

SwiftKit

Features

  • [x] Generated Kit supports iOS, tvOS, watchOS and macOS
  • [x] CocoaPods, Carthage and Swift Package Manager compatibility
  • [x] README.md template
  • [x] Fastlane already integrated for tests and release
  • [x] Jazzy to generate documentation
  • [x] SwiftLint Build-Phase integrated

Installation

Mint ?

Mint is a package manager that installs and runs Swift command line tool packages.

$ mint install SvenTiigi/SwiftKit
Bash

Homebrew ?

Homebrew is a free and open-source software package management system that simplifies the installation of software on Apple's macOS operating system.

$ brew tap SvenTiigi/SwiftKit
$ brew install swiftkit
Bash

Usage ?‍?

To create a new Kit simply run:

$ swiftkit new MyAwesomeKit
Bash

This will create a new folder in your current directory named by the name of your Kit

To create a Kit inside the current directory simply run:

$ swiftkit new
Bash

This will infer the Kit name based on your directory name

Kit-Structure ?

The upcoming sections will explain the structure of your generated Kit in detail.

Xcode Logo

Xcode Project Structure

In the generated Xcode project you will find four important directories.

Directory Description
Sources Where you place your Swift source files
Tests Place your Unit-Tests files
Example The iOS application example for your Kit
Configs All config files like Plist, Package.swift, Podspec, etc.
Swift File Logo

Kit.swift

In the aforementioned Sources directory you will find one Swift file which is named by your Kit.

// Include Foundation
@_exported import Foundation
Swift

This file is used to inherit the import of Foundation when importing your Kit.

Fastlane Logo

Fastlane

Every generated Kit will come along with a predefined Fastfile.

tests-Lane

The tests lane will run your Unit-Tests and verify that your Kit is Carthage and CocoaPods compatible.

$ fastlane ios tests
Bash

release-lane

The release lane will allow you to automatically release a new version of your Kit for Carthage/GitHub and CocoaPods.

$ fastlane ios release version:1.1.0
Bash

The lane verifies various aspects of your Kit.

Step Description
1 Ensure your are on a clean master branch
2 Run tests lane
3 Increment version
4 Add and push Git tag
5 Pushes the Podspec via pod trunk push

☝️ Please ensure you have registered your machine with pod trunk register in order to successfully push the Podspec to CocoaPods

GitHub

Start your next Open-Source Swift Framework 📦Read More

Latest commit to the master branch on 10-22-2022
Download as zip