Welcome to FoundationPlus, an extensive Swift library designed to enhance and simplify your coding experience with a range of utilities and extensions. This package extends the standard Swift Foundation library, adding functionalities that are commonly needed but not present in the default implementation.
FoundationPlus offers a variety of features to streamline your Swift development:
- Boolean Enhancements: Adds a
.negatedproperty for more intuitive handling of boolean logic. - CGPoint Utilities: Easy calculation of distances between points.
- Character and String Constants: Includes useful constants like
.space,.newline,.tabonCharacter, and.emptyforString. - Collection Extensions: Introduces
.indexedfor Collections, yielding (Index, Element) pairs. - Date and Time Enhancements: Simplifies date and time handling with methods like
dateOnly,timeIntervalUntilNow, and convenient initializers. - Double Formatting: Versatile
toFormattedStringmethod forDoubletypes. - TimeInterval Extensions: Includes units and components for more expressive time interval calculations.
- Property Wrappers: Offers a range of property wrappers like
EquatablePublished,BackgroundPublished, andSettingStoragefor more efficient state management. - Combine Publishers: Introduces
Publishableprotocol andPublishablePublisherfor more flexible data publishing.
And much more, with continuous additions and updates to enhance your Swift development workflow.
You can easily integrate FoundationPlus into your Swift project using Swift Package Manager. Here's how:
- In Xcode, select "File" > "Swift Packages" > "Add Package Dependency..."
- Enter the repository URL:
https://github.com/FiveSheepCo/FoundationPlus.git - Follow the on-screen instructions to complete the installation.
To start using FoundationPlus, simply import the package into your Swift files:
import FoundationPlusThen, you can directly access the new features and enhancements provided by the package.
Also check out our other Swift packages:
- SwiftUIElements: SwiftUI components, extensions, and utilities for painless UI development.
We're always looking for ways to improve FoundationPlus and we welcome contributions. Whether it's a bug report, a feature request, or a pull request, your input is invaluable to us.
FoundationPlus is available under the MIT license. See the LICENSE file for more info.