You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
A Swift utility package with zero external dependencies, providing reusable extensions for primitive types, SwiftUI views, dates, collections, and more. Includes scroll offset tracking, observation helpers, photo picking utilities, localization support, and a DomainModelable protocol for Clean Architecture mapping.
Concurrent async iteration with optional concurrency limit
π KeyPath
Extension
Description
.pathName
Last component of a key path as a String
.partialPathName
Full key path string without the root type prefix
.map(_:keyPath:)
Maps a sequence by key path
.sorted(by:keyPath:)
Sorts a sequence by a comparable key path
==, !=, < operators
Predicate builders for key path comparisons
prefix ! operator
Negates a Bool key path predicate
π¦ Data
Extension
Description
.base64
Base64-encoded string
.resizedImageData
Resizes image data to a max of 1920Γ1080 with 0.7 JPEG quality
π URL
Extension
Description
.isDirectory
Checks whether the URL points to a directory
.isVideo
Checks whether the URL points to a video file using UTType
π‘ Encodable
Extension
Description
.json
Encodes the value to a sorted-keys JSON string
SwiftUI Extensions
π¨ Color
Extension
Description
Color(hex: UInt, alpha:)
Initializes from a hex integer (e.g., 0xFF0000)
Color(hex: String?, defaultColor:, alpha:)
Initializes from a hex string ("#RGB", "#RRGGBB", "#RRGGBBAA")
.hexString / .hexStringWithAlpha
Converts back to a hex string
.isDark
Detects whether the color is perceived as dark
.lighterGray / .borderedViewColor
Convenience static colors
π View
Extension
Description
.flipped(_:)
Flips a view horizontally or vertically
.withoutAnimation(action:)
Executes a state change with animations disabled
.border(width:edges:color:)
Applies a border to specific edges only
.border(width:axis:color:)
Applies a border along a horizontal or vertical axis
.onSizeChange(closure:)
Observes view size changes via GeometryReader and PreferenceKey
.onScrollOffsetChange(closure:)
Tracks horizontal scroll offset
π ScrollableContent
A protocol that provides a type-safe scrollToTopViewID string, ready to use with ScrollViewReader.
structMyView:View,ScrollableContent{
// scrollToTopViewID is automatically provided
}
πΌ PhotosPickerItem
Extension
Description
.photoPickerItemMedia
Async property that loads the picked item as a PhotosPickerItemMedia
π EdgeInsets
Extension
Description
.zero
Convenience EdgeInsets with all values set to 0
Architecture
DomainModelable
A protocol for mapping data/DTO objects to domain models, aligned with Clean Architecture:
publicprotocolDomainModelable{associatedtypeDomainModel:SendablevardomainModel:DomainModel{get}varessentialDomainModel:DomainModel{get} // defaults to domainModel
}
Observation
makeObservationTask(of:fireImmediately:onChangeAsync:) creates a self-rearming @MainActorTask that re-fires on every @Observable property change β a clean alternative to manual withObservationTracking loops.
A Swift utility package with zero external dependencies, providing reusable extensions for primitive types, SwiftUI views, dates, collections, and more. Includes scroll offset tracking, observation helpers, photo picking utilities, localization support, and a DomainModelable protocol for Clean Architecture mapping.