Swift CLI tool that generates type-safe enums for iOS/macOS assets like images, colors, fonts, storyboards, and localizations.
Shark is a Swift command-line tool that generates type-safe Swift enums for assets like images, colors, fonts, storyboards, and localizations in iOS and macOS projects. It reads Xcode project files to automatically create compile-time-safe references, eliminating stringly-typed access and reducing runtime errors. The tool supports UIKit, AppKit, and SwiftUI, integrating seamlessly into Xcode build phases.
iOS and macOS developers working with UIKit, AppKit, or SwiftUI who want to improve asset management safety and maintainability in their Xcode projects.
Developers choose Shark because it provides a simple, automated way to achieve type safety for assets across multiple Apple frameworks, with minimal setup and robust customization options. It fills gaps where Xcode's native type-safe resources are limited, particularly for fonts and storyboards.
Swift CLI for strong-typing images, colors, storyboards, fonts and localizations
Open-Awesome is built by the community, for the community. Submit a project, suggest an awesome list, or help improve the catalog on GitHub.
Automatically creates Swift enums for images, colors, fonts, storyboards, and localizations, replacing error-prone string literals as shown in the example Shark.swift file.
Generates code for UIKit, AppKit, and SwiftUI from a single tool via the --framework flag, providing flexibility across Apple's UI ecosystems.
Respects Xcode asset catalog folder structures with the 'Provides Namespace' setting to create nested enums, organizing assets without manual effort.
Easily integrates into Xcode run scripts with options like --deps for dependency tracking to optimize incremental builds and reduce unnecessary runs.
Without advanced setup using dependency files, Shark runs on every build, adding several seconds to build times as noted in the README's setup section.
Xcode 15 and 25 have sherlocked Shark for type-safe colors, images, and localizations, reducing its unique value to only fonts and storyboards, as admitted in the README.
Shark requires .xcodeproj files to locate assets, making it incompatible with projects using Swift Package Manager or other build systems without Xcode projects.