Swiftpack.co - Quintschaf/SchafKit as Swift Package

Swiftpack.co is a collection of thousands of indexed Swift packages. Search packages.
See all packages published by Quintschaf.
Quintschaf/SchafKit 1.2.1
An open kit providing useful functionality across iOS, watchOS, macOS and tvOS, taking advantage of Swifts rich feature set.
⭐️ 7
🕓 22 weeks ago
iOS macOS watchOS tvOS
.package(url: "https://github.com/Quintschaf/SchafKit.git", from: "1.2.1")



Up to date documentation can be found at: SchafKit Wiki

A kit providing useful functions across iOS, watchOS, macOS and tvOS, taking advantage of Swifts rich feature set.




SKCryptography is a wrapper around TweetNacl, providing the Curve25519XSalsa20Poly1305BoxAlgorithm, XSalsa20Poly1305SecretBoxAlgorithm and Ed25519Algorithm classes.


SKDispatchHelper helps submitting blocks to dispatch queues.

    on: .main,
    block: {
   // Do something here

File System

SKFileSystemItem and its subclasses SKFile and SKDirectory provide easy access to the File System.


Networking offers an easy way to send simple or advanced network requests. The examples below use Swift 5.5's await. Everything is also possible to use with a callback.


do {
    let result = try await SKNetworking.request(
        url: "https://github.com/Quintschaf/SchafKit"
    print(result.stringValue) // Prints the html received


let block : SKNetworking.RequestCompletionBlock = { (result, error) -> Void in 
    // Do something here, for example: result.jsonValue?["Test"]["Toast"]

let headerFields : [SKNetworking.Request.HeaderField: String] = [
    .accept : "*/*",
    "CustomField" : "CustomValue"

let result = SKNetworking.request(
    url: "https://github.com/JannThomas/OpenKit",
    options: [
        .requestMethod(value: .post), 
        .headerFields(value: headerFields), 
        .body(value: .xWwwFormUrlencoded(value: ["Key" : "Value"]))

// Do something with the result


SKRegexMatch handles regular expressions.

guard let matches = "Test".regexMatches(with: "(T)est") else {

print(matches.first?.captureGroups.first) // "T"


A big part of SchafKit are extensions. You can find all of them in the documentation, but here are the most important ones with examples.


Static Variables

Variable Return Type Description Result
empty String An empty string. ""
space String A string containing a space character. " "
newline String A string containing a newline character. "\n"
tab String A string containing a tab character. "\t"


Variable Return Type Description Example Result
localized String A localized version of the receiver. "DONE_BUTTON_TEXT".localized "Done"
urlEncoded String A URL-encoded version of the receiver. "https://quintschaf.com".urlEncoded "https%3A%2F%2Fquintschaf.com"
urlDecoded String A URL-decoded version of the receiver. "https%3A%2F%2Fquintschaf.com".urlDecoded "https://quintschaf.com"
extractedSeconds Int? Extracts number of seconds from the receiver in a hh:mm:ss/mm:ss/ss format. "00:02:15".extractedSeconds 135

SchafKit also includes sane subscripts for Strings, making syntax like "abc"[0...1] possible.


Swift Package Manager

SchafKit relies on Swift Package Manager and is installed by adding it as a dependency.


We have chosen to use the CC0 1.0 Universal license for SchafKit. The following short explanation has no legal implication whatsoever and does not override the license in any way: CC0 1.0 Universal license gives you the right to use or modify all of SchafKits code in any (commercial or non-commercial) product without mentioning, licensing or other headaches of any kind.


  • ☐ Implement SKFile
  • ☐ Uploading in Networking
  • ☐ More Extension Examples in README
  • ☐ Full Documentation
    • SKAlerting
    • SKStoreKitHelper
    • SKJsonRepresentable
    • ☐ Custom SwiftUI components


Stars: 7
Last commit: 3 weeks ago
jonrohan Something's broken? Yell at me @ptrpavlik. Praise and feedback (and money) is also welcome.

Release Notes

Swiftpack is being maintained by Petr Pavlik | @ptrpavlik | @swiftpackco | API | Analytics