SwiftKit
Start your next Open-Source Swift Framework ๐ฆ
Install / Use
/learn @SvenTiigi/SwiftKitREADME
Features
- [x] Generated Kit supports
iOS,tvOS,watchOSandmacOS - [x]
CocoaPods,CarthageandSwift Package Managercompatibility - [x]
README.mdtemplate - [x] Fastlane already integrated for
testsandrelease - [x]
Jazzyto generate documentation - [x]
SwiftLintBuild-Phase integrated - [x]
CI-Serviceconfiguration templates included (GitHub, Travis, GitLab, Azure Pipelines) - [x] Automatically checks if the Kit name is already taken on
CocoaPods - [x] GitHub issue templates for
Bug reportsandFeature requests
Installation
Mint ๐ฑ
Mint is a package manager that installs and runs Swift command line tool packages.
$ mint install SvenTiigi/SwiftKit
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
Update
To update SwiftKit to the latest version simply run:
$ swiftkit update
The
updatecommand will only work if SwiftKit is installed either via Mint ๐ฑ or Homebrew ๐บ
Usage ๐จโ๐ป
To create a new Kit simply run:
$ swiftkit new MyAwesomeKit
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
This will infer the Kit name based on your directory name
If you wish to open the Xcode project after your Kit has been generated simply run:
$ swiftkit new MyAwesomeKit --open
Head over to the
Argumentssection to learn more about the available arguments
In default SwiftKit will create a Kit that supports iOS, tvOS, watchOS, macOS. If you want to support only certain Targets simply run:
$ swiftkit new MyAwesomeKit --target iOS --target tvOS
This will create a Kit which only supports
iOSandtvOS
Kit-Structure ๐ฆ
The upcoming sections will explain the structure of your generated Kit in detail.
<img style="float: right" align="right" width="100" src="https://raw.githubusercontent.com/SvenTiigi/SwiftKit/gh-pages/readMeAssets/xcode-logo.png" alt="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. |
Kit.swift
In the aforementioned Sources directory you will find one Swift file which is named by your Kit.
// Include Foundation
@_exported import Foundation
This file is used to inherit the import of
Foundationwhen importing your Kit.
<a href="https://fastlane.tools/"><img style="float: right" align="right" width="100" src="https://raw.githubusercontent.com/SvenTiigi/SwiftKit/gh-pages/readMeAssets/fastlane-logo.png" alt="Fastlane Logo"></a>
Fastlane
Every generated Kit will come along with a predefined Fastfile.
tests-Lane
The tests lane will run your Unit-Tests.
$ fastlane ios tests
compatibilityTests-Lane
The compatibilityTests lane will verify that your Kit is Carthage, CocoaPods and Swift Package Manager compatible.
$ fastlane ios compatibilityTests
release-lane
The release lane will allow you to automatically release a new version of your Kit.
$ fastlane ios release version:1.1.0
The lane verifies various aspects of your Kit.
| Step | Description |
| --- | --- |
| 1 | Ensure your are on a clean master branch |
| 2 | Run compatibilityTests lane |
| 3 | Run tests lane |
| 4 | Increment version |
| 5 | Add and push Git tag |
| 6 | Pushes the Podspec via pod trunk push |
โ๏ธ Please ensure you have registered your machine with
pod trunk registerin order to successfully push the Podspec to CocoaPods
ReadMe
<img style="float: right;" align="right" src="https://raw.githubusercontent.com/SvenTiigi/SwiftKit/gh-pages/readMeAssets/TemplateReadMe.png" width="30%" alt="Template ReadMe">A README.md template file will be automatically created inside your Kit.
The README comes along with typical sections like:
<br/>- Project description
- Example
- Installation
- Usage
- Contributing
- License
Please feel free to update the ReadMe to your needs ๐
Environment-Configuration
You can place a JSON environment configuration file in your home directory ~/.swiftkit-env.json to provide default values for:
| Key | Description |
| ----------- | ----------- |
| authorName | The author name |
| authorEmail | The author email address |
| organizationName | The organization name |
| organizationIdentifier | The organization identifier |
SwiftKit will use those values and skip the corresponding CLI questions when running swiftkit new.
{
"authorName": "Sven Tiigi",
"authorEmail": "sven.tiigi@gmail.com",
"organizationName": "Sven Tiigi",
"organizationIdentifier": "de.tiigi"
}
Path:
~/.swiftkit-env.json
The environment config values will only be used if no argument for the corresponding value is present.
Arguments
Beside using the CLI inputs SwiftKit supports arguments when launched. The following arguments are supported:
| Long parameter | Short parameter | Description
| ----------- | ----------- | -------------- |
| --target | -t | The Target that should be included in your Kit ๐ฑ |
| --destination | -d | Where the generated Kit should be saved ๐พ |
| --kit-name | -k | The name of your Kit ๐ฆ |
| --name | -n | Your name ๐จโ๐ป |
| --email | -e | Your email address ๐ซ |
| --url | -u | The repository url ๐ |
| --ci-service | -c | The CI-Service ๐ <br/> 1 = Travis CI - macOS only <br/> 2 = Travis CI - macOS & Linux <br/> 3 = GitLab CI <br/> 4 = Azure Pipelines <br/> 5 = GitHub CI |
| --organization | -o | The name of your organization ๐ข |
| --organization-identifier | -i | The organization identifier ๐ |
| --repository | -r | The SwiftKit template repository url ๐ |
| --force | -f | Generate the Kit without confirmation โ
|
| --open | -o | Open the Xcode project after your Kit has been generated ๐ |
Example with all arguments been set.
swiftkit new \
--target iOS \
--target tvOS \
--target watchOS \
--target macOS \
--destination ~/Desktop/MyAwesomeKit \
--kit-name MyAwesomeKit \
--name SvenTiigi \
--email sven.tiigi@gmail.com \
--url https://github.com/SvenTiigi/MyAwesomeKit \
--ci-service 1 \
--organization SvenTiigi \
--organization-identifier com.tiigi \
--repository https://github.com/SvenTiigi/SwiftKit.git \
--force \
--open
Featured on
Contributing
Contributions are very welcome ๐ ๐ค
Credits
SwiftKit is inspired by [SwiftPlate](https://github.com/JohnSundell/SwiftPlate
Related Skills
node-connect
352.2kDiagnose OpenClaw node connection and pairing failures for Android, iOS, and macOS companion apps
frontend-design
111.1kCreate distinctive, production-grade frontend interfaces with high design quality. Use this skill when the user asks to build web components, pages, or applications. Generates creative, polished code that avoids generic AI aesthetics.
openai-whisper-api
352.2kTranscribe audio via OpenAI Audio Transcriptions API (Whisper).
qqbot-media
352.2kQQBot ๅฏๅชไฝๆถๅ่ฝๅใไฝฟ็จ <qqmedia> ๆ ็ญพ๏ผ็ณป็ปๆ นๆฎๆไปถๆฉๅฑๅ่ชๅจ่ฏๅซ็ฑปๅ๏ผๅพ็/่ฏญ้ณ/่ง้ข/ๆไปถ๏ผใ
