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
.negated
property 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
,.tab
onCharacter
, and.empty
forString
. - Collection Extensions: Introduces
.indexed
for 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
toFormattedString
method forDouble
types. - TimeInterval Extensions: Includes units and components for more expressive time interval calculations.
- Property Wrappers: Offers a range of property wrappers like
EquatablePublished
,BackgroundPublished
, andSettingStorage
for more efficient state management. - Combine Publishers: Introduces
Publishable
protocol andPublishablePublisher
for 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 FoundationPlus
Then, 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.