A Swift script that generates type-safe Swift code from Xcode Asset Catalogs for easier image management.
Misen is a Swift script that generates type-safe Swift code from Xcode Asset Catalogs. It scans asset catalogs and creates an enum and UIImage extension, allowing developers to reference images using compile-time checked enums instead of error-prone string literals.
iOS and macOS developers using Swift who work with Xcode Asset Catalogs and want to improve code safety and maintainability in their projects.
Developers choose Misen because it eliminates runtime crashes from typos in asset names, reduces boilerplate code, and integrates seamlessly into Xcode workflows with minimal setup.
Script to support easily using Xcode Asset Catalog in Swift.
Open-Awesome is built by the community, for the community. Submit a project, suggest an awesome list, or help improve the catalog on GitHub.
Generates an enum from asset names, so typos like 'cmera' instead of 'camera' are caught during compilation, as shown in the code example where 'ImageAsset.camera.image' is used.
Scans sub-directories in the Asset Catalog to discover all image sets automatically, reducing manual effort in listing assets, per the 'Features' section.
Provides a UIImage extension with a non-failable initializer that accepts the enum, making code cleaner and less error-prone, as demonstrated in the ViewController sample.
Allows specifying the output file path and custom enum name via command-line arguments like -enumName, facilitating seamless addition to existing codebases.
The script must be run manually or set up in a custom build phase, adding overhead compared to tools that integrate automatically into Xcode's build process, as it lacks built-in automation.
Only supports image sets from Asset Catalogs, ignoring other resources like color sets or data assets, which limits its utility in modern iOS development with comprehensive asset management needs.
The README specifies Xcode 8.0 and Swift 3.0, which are old; users on newer Xcode and Swift versions might face compatibility issues or need modifications for the script to work correctly.