A Swift command-line tool that generates type-safe code from storyboard files to eliminate string identifiers for segues and reusable views.
Natalie is a Swift command‑line application that generates type‑safe Swift code from storyboard files. It creates enums and extensions that replace string‑based identifiers for segues, storyboards, and reusable views with compile‑time‑checked types, reducing errors and improving developer experience in UIKit/AppKit projects.
iOS and macOS developers who use Storyboards in their Swift projects and want to eliminate fragile string identifiers for segues, storyboard instantiation, and reusable view cells.
Developers choose Natalie because it provides compile‑time safety for Storyboard operations without requiring a rewrite of their UI layer. It integrates seamlessly into Xcode builds, automatically keeping generated code in sync, and reduces boilerplate while preventing common runtime crashes from typos in string identifiers.
Natalie - Storyboard Code Generator (for 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 `Storyboards` with methods like `instantiateInitialViewController()` to replace `UIStoryboard(name:, bundle:)` calls, eliminating error-prone string literals for storyboard names.
Extends each view controller with a `Segue` enum providing strongly-typed identifiers, kind, and destination types, usable in `prepareForSegue` and `performSegue` for compile-time safety.
Creates `Reusable` enums for table/collection view cells, enabling `dequeueReusableCell` calls without string literals and `registerReusableCell` with type-safe identifiers, as shown in the UITableView examples.
Generates static `UIColor`/`NSColor` properties for named colors used in storyboards, available for iOS 11+ and macOS 10.13+, reducing hard-coded color strings.
Can be added as a Run Script Phase to automatically regenerate code when storyboards change, keeping the generated file up-to-date with every build, as detailed in the installation instructions.
The README describes it as a 'proof-of-concept implementation,' which may imply incomplete features, less active maintenance, or instability compared to production-ready tools.
Separate branches for Swift 3.x, 2.x, and 1.x indicate compatibility issues and potential breaking changes with Swift updates, requiring manual branch management and increasing setup complexity.
Integrating with Xcode requires adding a custom Run Script Phase and configuring paths to the natalie binary, which can be error-prone and difficult for teams unfamiliar with build processes.
Only supports .storyboard files; it does not generate code for XIB files or other UI components, limiting its utility in projects with mixed UI formats or programmatic views.