A Swift reflection library for converting dictionaries to models, models to dictionaries, and one-key archiving.
Reflect is a Swift library that provides reflection utilities to convert dictionaries to models, models to dictionaries, and handle archiving with minimal code. It solves the problem of manual data parsing and serialization in iOS apps, automating tasks like JSON mapping and object persistence. The library is designed for Swift 2.0 and iOS 7.0+, leveraging reflection to reduce boilerplate.
iOS developers working with Swift who need to parse JSON, serialize models, or archive data without writing repetitive conversion code. It's especially useful for those handling network responses or local data storage.
Developers choose Reflect for its simplicity and productivity gains—it eliminates the need for manual Codable implementations or third-party dependencies, offering built-in cascade support, property mapping, and one-key archiving directly in Swift.
Reflection, Dict2Model, Model2Dict, Archive
Open-Awesome is built by the community, for the community. Submit a project, suggest an awesome list, or help improve the catalog on GitHub.
Automates dictionary-to-model and model-to-dictionary conversions, eliminating manual parsing code as shown with examples like `Student1.parse(dict:)` in the README.
Handles nested objects automatically in conversions, reducing complexity for hierarchical data without extra code.
Provides one-key methods to save and load objects from the Caches folder, demonstrated with `Book2.save(obj:name:)` and `Book3.read(name:)`.
Allows custom mapping between dictionary keys and property names via `mappingDict()`, easing integration with varied API responses.
Built for Swift 2.0 and iOS 7.0+, making it incompatible with modern Swift features like Codable and potentially unsupported in current Xcode.
Requires all models to inherit from the `Reflect` class, forcing a specific architecture and preventing the use of structs or other base classes.
Admits struggles with complex optional types and lacks support for Core Data or structs, as noted in the README, restricting its use cases.
Relies on Swift's reflection, which is slower and less type-safe than compile-time solutions, potentially impacting app performance for large datasets.