An open API service indexing awesome lists of open source software.

https://github.com/orchetect/swift-extensions

Useful extensions on Swift standard library types.
https://github.com/orchetect/swift-extensions

ios mac-catalyst maccatalyst macos shared-code swift5 swift5-3 tvos utilities utility watchos

Last synced: 7 days ago
JSON representation

Useful extensions on Swift standard library types.

Awesome Lists containing this project

README

          

# swift-extensions

[![](https://img.shields.io/endpoint?url=https%3A%2F%2Fswiftpackageindex.com%2Fapi%2Fpackages%2Forchetect%2Fswift-extensions%2Fbadge%3Ftype%3Dplatforms)](https://swiftpackageindex.com/orchetect/swift-extensions) [![](https://img.shields.io/endpoint?url=https%3A%2F%2Fswiftpackageindex.com%2Fapi%2Fpackages%2Forchetect%2Fswift-extensions%2Fbadge%3Ftype%3Dswift-versions)](https://swiftpackageindex.com/orchetect/swift-extensions) [![Xcode 16](https://img.shields.io/badge/Xcode-16-blue.svg?style=flat)](https://developer.apple.com/swift) [![License: MIT](http://img.shields.io/badge/license-MIT-lightgrey.svg?style=flat)](https://github.com/orchetect/swift-extensions/blob/main/LICENSE)

Multi-platform general-purpose Swift extensions.

The library has full unit test coverage and is actively used in production.

## Installation: Swift Package Manager (SPM)

### Dependency within an Application Project

1. Add the package to your Xcode project using Swift Package Manager using `https://github.com/orchetect/swift-extensions` as the URL.

2. Import the module files where needed. It's recommended to use the `internal` access level if used in a package so that it is not exported to the user of your package.

```swift
internal import SwiftExtensions
```

### Dependency within a Swift Package

In your Package.swift file:

```swift
let package = Package(
dependencies: [
.package(url: "https://github.com/orchetect/swift-extensions", from: "2.1.1")
],
targets: [
.target(
dependencies: [
.product(name: "SwiftExtensions", package: "swift-extensions")
]
)
]
)
```

## Documentation

Most methods are implemented as category methods so they are generally discoverable.

All methods are documented with inline help explaining their purpose and basic usage examples.

## Author

Coded by a bunch of 🐹 hamsters in a trenchcoat that calls itself [@orchetect](https://github.com/orchetect).

## License

Licensed under the MIT license. See [LICENSE](https://github.com/orchetect/swift-extensions/blob/master/LICENSE) for details.

## Community & Support

Please do not email maintainers for technical support. Several options are available for issues and questions:

- Questions and feature ideas can be posted to [Discussions](https://github.com/orchetect/swift-extensions/discussions).
- If an issue is a verifiable bug with reproducible steps it may be posted in [Issues](https://github.com/orchetect/swift-extensions/issues).

## Contributions

Contributions are welcome. Posting in [Discussions](https://github.com/orchetect/swift-extensions/discussions) first prior to new submitting PRs for features or modifications is encouraged.

## Legacy

This repository was formerly known as OTCore.