A Swift 6 package providing foundational utilities for Apple platforms — logging, retry strategies, persistent storage, SwiftUI components, and UIKit helpers.
Developed by Kelvin Kosbab — kelvin.kosbab@kozinga.net
| Module | Description |
|---|---|
| Core | Logging, retry strategies, and background task orchestration |
| CoreUI | SwiftUI components, view modifiers, color utilities, and toast system |
| CoreUIKit | UIKit view controllers, presentation helpers, color utilities, and font registration |
| CoreStorage | CoreData helpers and a lightweight disk-backed key-value store |
| RunMode | Detect whether the current process is the main app, unit tests, or UI tests |
Platform Support:
- iOS 17.0
- macOS 14.0
- tvOS 17.0
- watchOS 10.0
- visionOS 1.0
Swift Version: 6.0 with strict concurrency
Each module is organized with colocated sources and tests:
BasicSwiftUtilities/
Package.swift
Core/
Sources/
Tests/
CoreUI/
Sources/
Tests/
CoreUIKit/
Sources/
CoreStorage/
Sources/
Tests/
RunMode/
Sources/
Tests/
Provides logging, retry strategies, and background task management.
- Logging —
Loggerwraps Apple'sos.Loggerwith category-tagged, privacy-aware log messages. See theLoggableprotocol for the logging interface. - Retry —
retry()andasyncRetry()support configurable backoff strategies (exponential, linear, constant, custom) with jitter. SeeRetryStrategy. - Background Tasks —
LongRunningTaskOrchestratorregisters tasks that should continue when the app enters the background.
For details see Core's Documentation.
SwiftUI components, modifiers, and utilities.
- Toast System —
ToastApiwith configurable position, shape, and animation style - Color Utilities — Define colors using hex values via
Color.hex(0x5B2071) - Layout —
Spacingconstants,SafeAreaInsets,CircleImage, conditional view transforms - View Modifiers — Light-mode-only shadows, auto-dismiss control, dynamic type scroll wrapping
For details see CoreUI's Documentation.
UIKit utilities, view controllers, and presentation helpers.
- View Controllers —
BaseHostingControllerfor mounting SwiftUI in UIKit,BaseNavigationControllerwith built-in styling,PresentableControllerprotocol - Interactive Transitions — Gesture-driven presentation and dismissal
- Color Utilities —
UIColorhex, RGB, and HSB extensions - Font Registration —
FontRegistrarfor programmatic custom font loading
For details see CoreUIKit's Documentation.
Persistent storage utilities using CoreData and a lightweight disk-backed key-value store.
- CoreData —
PersistentDataContainerfor store loading,DataObserverfor change notifications, andObjectStorefor type-safe CRUD operations - CodableStore —
DiskBackedJSONCodableStoreprovides a simple key-value API for anyCodable & Sendabletype, backed by JSON files on disk
For details see CoreStorage's Documentation.
Detects the active run mode of the current process.
let activeRunMode = RunMode.getActive()
// .mainApplication, .unitTests, or .uiUnitTestsFor details see RunMode's Documentation.
- [Toasts] Add flexibility so developers can render any
Viewas the toast content without enforcing aStringtitle. - [Toasts] Add ability to customize appearance with app-specific font, not just the default system fonts.
- [Toasts] Apply a minimum capsule size if no content is present.
- [Accessibility] Add utilities for accessibility.
See HelpfulResources.md for educational notes on Swift concepts like
class vs struct, Automatic Reference Counting, and more.
See LICENSE.