SKCryptography is a wrapper around TweetNacl, providing the Curve25519XSalsa20Poly1305BoxAlgorithm, XSalsa20Poly1305SecretBoxAlgorithm and Ed25519Algorithm classes.
Dispatch
SKDispatchHelper helps submitting blocks to dispatch queues.
SKDispatchHelper.dispatch(
on: .main,
block: {
// Do something here
})
File System
SKFileSystemItem and its subclasses SKFile and SKDirectory provide easy access to the File System.
Networking
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.
Simple:
do {
let result = try await SKNetworking.request(
url: "https://github.com/Quintschaf/SchafKit"
)
print(result.stringValue) // Prints the html received
}
Advanced:
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
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.
Installation
Swift Package Manager
SchafKit relies on Swift Package Manager and is installed by adding it as a dependency.
License
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.
SchafKit
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.
Features
Components
Cryptography
SKCryptography
is a wrapper around TweetNacl, providing theCurve25519XSalsa20Poly1305BoxAlgorithm
,XSalsa20Poly1305SecretBoxAlgorithm
andEd25519Algorithm
classes.Dispatch
SKDispatchHelper
helps submitting blocks to dispatch queues.File System
SKFileSystemItem
and its subclassesSKFile
andSKDirectory
provide easy access to the File System.Networking
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.Simple:
Advanced:
RegEx
SKRegexMatch
handles regular expressions.Extensions
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.String
Static Variables
Variables
"DONE_BUTTON_TEXT".localized
"https://quintschaf.com".urlEncoded
"https%3A%2F%2Fquintschaf.com".urlDecoded
"00:02:15".extractedSeconds
SchafKit also includes sane subscripts for Strings, making syntax like
"abc"[0...1]
possible.Installation
Swift Package Manager
SchafKit relies on Swift Package Manager and is installed by adding it as a dependency.
License
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.
To-Do
SKAlerting
SKStoreKitHelper
SKJsonRepresentable