Contents

stefanspringer1/swiftutilities

This is a collection of some Swift utilities.

Usage

Add the package in Package.swift:

.package(url: "https://github.com/stefanspringer1/SwiftUtilities", from: "...my minimal version..."),

Add as dependency of the target:

.product(name: "Utilities", package: "SwiftUtilities"),

Add an import statement in the source code:

import Utilities

Running the tests.

The environment variable TESTDATA should point to the subdirectory testdata (full path).

API documentation

Build the API documentation using DocC, e.g. in Xcode via the Product / Build Documentation command. Include the --include-extended-types option (available since Swift 5.8) to also document extensions to types from other modules: swift package generate-documentation --include-extended-types.

[^1]: see the Swift issue SR-15410

Overview

  • AutoreleasepoolShim.swift: Allowing you the use of auto-release pools to optimize memory footprint on Darwin platforms while maintaining compatibility with Linux where this API is not implemented (and not necessary).
  • CharacterUtilities.swift: Some definitions to be useful when working with characters, e.g. for characterizing them. Contains extensions of String and UnicodeScalar.
  • DataTypes.swift: Definitons of some helpful data types.
  • Errors.swift: Definition of a basic error with desription, and of the usefule operator ?!.
  • FileUtilities.swift: Some definitions to be useful when working with files, e.g. URL.files(withPattern:findRecursively:) to find files. Contains extensions of FileHandle, URL, [URL], and String.
  • Lengths.swift: Some definitions useful when working with lengths (e.g. in layouts).
  • Parallel.swift: Utilities for parallel execution.
  • Process.swift: Definitions useful for running external programs.
  • Properties.swift: Some definitions for working with key-value properties lists in files.
  • SequenceUtilities.swift: Definitions useful when working with sequences. Contains extensions of Sequence.
  • StringUtilities.swift: Definitions useful when working with string and substrings. Contains extensions of String, [String], and StringProtocol.
  • SystemUtilities.swift: Some definitions useful e.g. to find out about the current platform.
  • TimeUtilities.swift: Some definitions useful when working with time, e.g. for measuring durations.

Package Metadata

Repository: stefanspringer1/swiftutilities

Default branch: main

README: README.md