Foundation extensions and utilities for SwiftToolkit.
- Data compression utilities
- Error handling for compression operations
- Data unit conversions and formatting
- Image data handling extensions
- Time interval formatting and calculations
- Date and time utilities
- URL manipulation and formatting
- URL validation and processing
Add this to your package dependencies:
.package(url: "https://github.com/yourusername/SwiftToolkit.git", from: "1.0.0"),
Then include "STFoundation" as a dependency for your target:
.target(name: "YourTarget", dependencies: ["STFoundation"])
import STFoundation
// Compression example
let compressor = Compressor()
// Time formatting
let interval = TimeInterval(360)
let formatted = interval.formatted() // "6 minutes"
// URL manipulation
let url = URL(string: "https://example.com")!
let modified = url.appendingQueryItems(["key": "value"])