{"id":21169867,"url":"https://github.com/fivesheepco/schafkit","last_synced_at":"2025-12-11T23:02:06.146Z","repository":{"id":47116377,"uuid":"278692512","full_name":"FiveSheepCo/SchafKit","owner":"FiveSheepCo","description":"An open kit providing useful functionality across iOS, watchOS, macOS and tvOS, taking advantage of Swifts rich feature set.","archived":false,"fork":false,"pushed_at":"2024-02-24T20:03:13.000Z","size":519,"stargazers_count":8,"open_issues_count":0,"forks_count":1,"subscribers_count":1,"default_branch":"master","last_synced_at":"2024-10-29T10:17:24.017Z","etag":null,"topics":["framework","hacktoberfest","ios","kit","library","macos","swift","swiftui","tvos"],"latest_commit_sha":null,"homepage":"https://quintschaf.com/#/developers","language":"Swift","has_issues":true,"has_wiki":null,"has_pages":null,"mirror_url":null,"source_name":"JannThomas/OpenKit","license":"cc0-1.0","status":null,"scm":"git","pull_requests_enabled":true,"icon_url":"https://github.com/FiveSheepCo.png","metadata":{"files":{"readme":"README.md","changelog":null,"contributing":null,"funding":null,"license":"LICENSE","code_of_conduct":null,"threat_model":null,"audit":null,"citation":null,"codeowners":null,"security":null,"support":null,"governance":null,"roadmap":null,"authors":null,"dei":null}},"created_at":"2020-07-10T17:19:55.000Z","updated_at":"2024-05-09T11:19:56.000Z","dependencies_parsed_at":"2024-02-24T21:23:09.316Z","dependency_job_id":"61882dc8-85ce-4ca9-8d1f-558e38cb5426","html_url":"https://github.com/FiveSheepCo/SchafKit","commit_stats":null,"previous_names":["fivesheepco/schafkit","quintschaf/schafkit"],"tags_count":8,"template":false,"template_full_name":null,"repository_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/FiveSheepCo%2FSchafKit","tags_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/FiveSheepCo%2FSchafKit/tags","releases_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/FiveSheepCo%2FSchafKit/releases","manifests_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/FiveSheepCo%2FSchafKit/manifests","owner_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/owners/FiveSheepCo","download_url":"https://codeload.github.com/FiveSheepCo/SchafKit/tar.gz/refs/heads/master","host":{"name":"GitHub","url":"https://github.com","kind":"github","repositories_count":225587801,"owners_count":17492632,"icon_url":"https://github.com/github.png","version":null,"created_at":"2022-05-30T11:31:42.601Z","updated_at":"2022-07-04T15:15:14.044Z","host_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub","repositories_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories","repository_names_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repository_names","owners_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/owners"}},"keywords":["framework","hacktoberfest","ios","kit","library","macos","swift","swiftui","tvos"],"created_at":"2024-11-20T15:54:10.045Z","updated_at":"2025-12-11T23:02:05.722Z","avatar_url":"https://github.com/FiveSheepCo.png","language":"Swift","funding_links":[],"categories":[],"sub_categories":[],"readme":"# SchafKit\n\n[![GithubCI_Status]][GithubCI_URL] [![LICENSE_BADGE]][LICENSE_URL]\n\nUp to date documentation can be found at: [SchafKit Wiki](https://github.com/Quintschaf/SchafKit/wiki)\n\nA kit providing useful functions across iOS, watchOS, macOS and tvOS, taking advantage of Swifts rich feature set.\n\n- [Features](#features)\n   - [Components](#components)\n      - [Cryptography](#cryptography)\n      - [Dispatch](#dispatch)\n      - [File System](#file-system)\n      - [Networking](#networking)\n      - [RegEx](#regex)\n   - [Extensions](#extensions)\n-  [License](#license)\n-  [Installation](#installation)\n-  [To-Do](#to-do)\n\n# Features\n\n## Components\n\n### Cryptography\n`SKCryptography` is a wrapper around TweetNacl, providing the `Curve25519XSalsa20Poly1305BoxAlgorithm`, `XSalsa20Poly1305SecretBoxAlgorithm` and `Ed25519Algorithm` classes.\n\n### Dispatch\n`SKDispatchHelper` helps submitting blocks to dispatch queues.\n\n```swift\nSKDispatchHelper.dispatch(\n    on: .main,\n    block: {\n   // Do something here\n})\n```\n\n### File System\n`SKFileSystemItem` and its subclasses `SKFile` and `SKDirectory` provide easy access to the File System.\n\n### Networking\nNetworking 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.\n\nSimple:\n```swift\ndo {\n    let result = try await SKNetworking.request(\n        url: \"https://github.com/Quintschaf/SchafKit\"\n    )\n    \n    print(result.stringValue) // Prints the html received\n}\n\n```\n\nAdvanced:\n```swift\nlet block : SKNetworking.RequestCompletionBlock = { (result, error) -\u003e Void in \n    // Do something here, for example: result.jsonValue?[\"Test\"][\"Toast\"]\n}\n\nlet headerFields : [SKNetworking.Request.HeaderField: String] = [\n    .accept : \"*/*\",\n    \"CustomField\" : \"CustomValue\"\n]\n\nlet result = SKNetworking.request(\n    url: \"https://github.com/JannThomas/OpenKit\",\n    options: [\n        .requestMethod(value: .post), \n        .headerFields(value: headerFields), \n        .body(value: .xWwwFormUrlencoded(value: [\"Key\" : \"Value\"]))\n    ]\n)\n\n// Do something with the result\n```\n\n### RegEx\n`SKRegexMatch` handles regular expressions.\n\n```swift\nguard let matches = \"Test\".regexMatches(with: \"(T)est\") else {\n   return\n}\n\nprint(matches.first?.captureGroups.first) // \"T\"\n```\n\n## Extensions\n\nA big part of `SchafKit` are extensions. You can find all of them in the documentation, but here are the most important ones with examples.\n\n### `String`\n\n#### Static Variables\n| Variable         | Return Type | Description                                                                 | Result                         |\n|------------------|-------------|-----------------------------------------------------------------------------|--------------------------------|\n| empty            | String      | An empty string.                                                            | \"\"                             |\n| space            | String      | A string containing a space character.                                      | \" \"                            |\n| newline          | String      | A string containing a newline character.                                    | \"\\n\"                           |\n| tab              | String      | A string containing a tab character.                                        | \"\\t\"                           |\n\n#### Variables\n| Variable         | Return Type | Description                                                                 | Example                                     | Result                         |\n|------------------|-------------|-----------------------------------------------------------------------------|---------------------------------------------|--------------------------------|\n| localized        | String      | A localized version of the receiver.                                        | `\"DONE_BUTTON_TEXT\".localized`              | \"Done\"                         |\n| urlEncoded       | String      | A URL-encoded version of the receiver.                                      | `\"https://quintschaf.com\".urlEncoded`       | \"https%3A%2F%2Fquintschaf.com\" |\n| urlDecoded       | String      | A URL-decoded version of the receiver.                                      | `\"https%3A%2F%2Fquintschaf.com\".urlDecoded` | \"https://quintschaf.com\"       |\n| extractedSeconds | Int?        | Extracts number of seconds from the receiver in a hh:mm:ss/mm:ss/ss format. | `\"00:02:15\".extractedSeconds`               | 135                            |\n\nSchafKit also includes sane subscripts for Strings, making syntax like `\"abc\"[0...1]` possible.\n\n# Installation\n\n### Swift Package Manager\n\nSchafKit relies on Swift Package Manager and is installed by adding it as a dependency.\n\n# License\n\nWe 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.\n\n# To-Do\n- [ ] Implement SKFile\n- [ ] Uploading in [Networking](#networking)\n- [ ] More Extension Examples in README\n- [ ] Full Documentation\n    - [ ] `SKAlerting`\n    - [ ] `SKStoreKitHelper`\n    - [ ] `SKJsonRepresentable`\n    - [ ] Custom SwiftUI components\n\n\u003c!-- References --\u003e\n\n[GithubCI_Status]: https://github.com/Quintschaf/SchafKit/actions/workflows/swift.yml/badge.svg?branch=master\n[GithubCI_URL]: https://github.com/Quintschaf/SchafKit/actions/workflows/swift.yml\n[LICENSE_BADGE]: https://badgen.net/github/license/quintschaf/SchafKit\n[LICENSE_URL]: https://github.com/Quintschaf/SchafKit/blob/master/LICENSE\n","project_url":"https://awesome.ecosyste.ms/api/v1/projects/github.com%2Ffivesheepco%2Fschafkit","html_url":"https://awesome.ecosyste.ms/projects/github.com%2Ffivesheepco%2Fschafkit","lists_url":"https://awesome.ecosyste.ms/api/v1/projects/github.com%2Ffivesheepco%2Fschafkit/lists"}