A command-line tool that automatically generates a constants file from identifiers found in iOS/macOS storyboards.
SBConstants is a command-line tool that generates a constants file by extracting identifiers from storyboards in iOS or macOS projects. It automates the process of creating type-safe constants for segues, storyboard names, and cell reuse identifiers, reducing the risk of typos and making code more maintainable.
iOS and macOS developers using Xcode and storyboards who want to eliminate hard-coded strings and manage identifiers programmatically.
Developers choose SBConstants because it integrates seamlessly into Xcode build phases, supports both Objective-C and Swift, and offers customizable queries and templates to fit any project's needs.
SBConstants is a Ruby gem that scans storyboard files in an Xcode project and extracts identifiers (like segue identifiers, storyboard names, and cell reuse identifiers) to generate a constants file. This eliminates the need for hard-coded strings, reducing errors and improving maintainability in iOS and macOS development.
.h/.m files or Swift enums with the --swift flag.SBConstants believes in automating repetitive tasks to let developers focus on building features, ensuring that storyboard identifiers are consistently managed and type-safe.
Open-Awesome is built by the community, for the community. Submit a project, suggest an awesome list, or help improve the catalog on GitHub.
Scans storyboard XML files to automatically generate constants for segues, storyboard names, and cell reuse identifiers, reducing typos and manual errors as shown in the README's output examples.
Can be added as a build script phase in Xcode to regenerate constants on each build, ensuring identifiers stay in sync without developer intervention.
Supports a YAML file to define which identifiers to extract, allowing extensibility beyond defaults like adding custom nodes or attributes, as detailed in the queries option.
Generates constants in both Objective-C (.h/.m files) and Swift (enums) with the --swift flag, catering to mixed or transitioning codebases.
Out-of-the-box, it only parses storyboard files; while queries can be extended, it doesn't automatically support XIB files or other resources without manual configuration.
Requires developers to manually add build script phases and configure paths in Xcode, which can be error-prone and time-consuming for complex projects.
As a Ruby gem, it necessitates Ruby installation and management, which might not be standard in iOS toolchains and could complicate CI/CD environments.