A growing collection of reusable Swift utilities for iOS development. A new utility is added daily, targeting iOS 15+ / Swift 5.9+.
Add the package via Swift Package Manager:
https://github.com/pawankmrai/swift-utils.git
In your Package.swift:
dependencies: [
.package(url: "https://github.com/pawankmrai/swift-utils.git", branch: "main")
]
.target(
name: "MyApp",
dependencies: [
.product(name: "SwiftUtilsNetworking", package: "swift-utils"),
.product(name: "SwiftUtilsHelpers", package: "swift-utils"),
]
)Import only what you need: SwiftUtilsExtensions, SwiftUtilsNetworking, SwiftUtilsStorage, SwiftUtilsConcurrency, SwiftUtilsHelpers, SwiftUtilsUIUtilities, or SwiftUtils for everything.
| Utility | Category | Description | Docs |
|---|---|---|---|
| String+Extensions | Extensions | Email validation, trimming, truncation, slugify, snake_case | Examples & API |
| Array+Extensions | Extensions | Safe subscript, chunking, dedup, grouping, frequencies, key-path sort | Examples & API |
| Date+Extensions | Extensions | Relative formatting, components, arithmetic, ISO 8601, day comparisons | Examples & API |
| APIClient | Networking | Async/await HTTP client with auto JSON coding | Examples & API |
| UserDefaultsWrapper | Storage | @propertyWrapper for type-safe UserDefaults | Examples & API |
| KeychainWrapper | Storage | Type-safe Keychain for strings, Data, and Codable | Examples & API |
| DebounceThrottle | Concurrency | Thread-safe debouncer and throttler | Examples & API |
| SwiftLogger | Helpers | Leveled logger with categories and pluggable destinations | Examples & API |
| Validator | Helpers | Composable input validation with chainable rules | Examples & API |
| DeepLinkHandler | Helpers | Declarative URL routing with path params and wildcards | Examples & API |
| FeatureFlagManager | Helpers | Type-safe feature flags with overrides and observation | Examples & API |
| GradientBuilder | UI Utilities | Chainable gradient builder with presets and UIImage rendering | Examples & API |
| Optional+Extensions | Extensions | Unwrapping, chaining, filtering, zipping, and typed defaults for optionals | Examples & API |
| NotificationScheduler | Helpers | Fluent local notification scheduling with time, calendar, and recurring triggers | Examples & API |
| HapticFeedbackManager | Helpers | Thread-safe haptic feedback with patterns, presets, and custom intensity | Examples & API |
| DisplayFormatter | Helpers | Number, currency, percentage, file size, duration, ordinal, and compact formatting | Examples & API |
This project is licensed under the MIT License — see the LICENSE file for details.