Rename result builders to @UIViewBuilder and @AutoLayoutBuilder
New names @UIViewBuilder and @AutoLayoutBuilder, follow the conventions used by SwiftUI builders, such as @ViewBuilder. They are easier to remember and reason about.
Summary by CodeRabbit
- Refactor
- Streamlined internal builder naming conventions across the UIViewKit framework for enhanced code consistency and improved architectural clarity.
[!NOTE]
Reviews paused
Use the following commands to manage reviews:
@coderabbitai resumeto resume automatic reviews.@coderabbitai reviewto trigger a single review.
Walkthrough
This PR renames result builder enums and updates their usages across UIViewDSL files. IBArrayOfNSLayoutConstraintBuilder becomes AutoLayoutBuilder and IBArrayOfUIViewBuilder becomes UIViewBuilder. All function signatures, logic, and behavior remain unchanged.
Changes
| Cohort / File(s) | Summary |
|---|---|
Result Builder Enum DefinitionsSources/UIViewKit/UIViewDSL/ResultBuilder/UIViewDSL+AutoLayoutBuilder.swift, Sources/UIViewKit/UIViewDSL/ResultBuilder/UIViewDSL+UIViewBuilder.swift |
Renamed public enums: IBArrayOfNSLayoutConstraintBuilder → AutoLayoutBuilder and IBArrayOfUIViewBuilder → UIViewBuilder. Updated file header comments. buildBlock signatures remain identical. |
Builder Usage UpdatesSources/UIViewKit/UIViewDSL/UIViewDSL+IBAttributes.swift, Sources/UIViewKit/UIViewDSL/UIViewDSL+IBSubviews.swift, Sources/UIViewKit/UIViewDSL/UIViewDSL+NSLayoutConstraint.swift |
Updated method parameter attributes from old builder names to new ones: @IBArrayOfNSLayoutConstraintBuilder → @AutoLayoutBuilder and @IBArrayOfUIViewBuilder → @UIViewBuilder. Method signatures, return types, and logic unchanged. |
Estimated code review effort
🎯 2 (Simple) | ⏱️ ~8 minutes
- Straightforward, homogeneous refactoring with consistent naming patterns across files
- No logic changes, behavioral modifications, or control flow alterations
- Primarily identifier/attribute replacements with predictable scope
Poem
🐰 The builders had their names refined,
From old to new, a cleaner find,
AutoLayout and UIView now shine,
No logic changed—just signs align! ✨
Pre-merge checks and finishing touches
❌ Failed checks (1 warning)
| Check name | Status | Explanation | Resolution |
|---|---|---|---|
| Docstring Coverage | ⚠️ Warning | Docstring coverage is 0.00% which is insufficient. The required threshold is 80.00%. | You can run @coderabbitai generate docstrings to improve docstring coverage. |
✅ Passed checks (2 passed)
| Check name | Status | Explanation |
|---|---|---|
| Description Check | ✅ Passed | Check skipped - CodeRabbit’s high-level summary is enabled. |
| Title check | ✅ Passed | The pull request title directly and accurately describes the main changes: renaming the result builders from IBArrayOfNSLayoutConstraintBuilder to AutoLayoutBuilder and from IBArrayOfUIViewBuilder to UIViewBuilder across multiple files. |
✨ Finishing touches
- [ ] 📝 Generate docstrings
🧪 Generate unit tests (beta)
- [ ] Create PR with unit tests
- [ ] Post copyable unit tests in a comment
- [ ] Commit unit tests in branch
develop
📜 Recent review details
Configuration used: CodeRabbit UI
Review profile: CHILL
Plan: Pro
📥 Commits
Reviewing files that changed from the base of the PR and between 6b7882699c76d9e56f5c5b04edff1e8a785ca629 and 0070ba6a4f95f1e0a518d721820bb44744527d3e.
📒 Files selected for processing (5)
Sources/UIViewKit/UIViewDSL/ResultBuilder/UIViewDSL+AutoLayoutBuilder.swift(2 hunks)Sources/UIViewKit/UIViewDSL/ResultBuilder/UIViewDSL+UIViewBuilder.swift(2 hunks)Sources/UIViewKit/UIViewDSL/UIViewDSL+IBAttributes.swift(1 hunks)Sources/UIViewKit/UIViewDSL/UIViewDSL+IBSubviews.swift(1 hunks)Sources/UIViewKit/UIViewDSL/UIViewDSL+NSLayoutConstraint.swift(1 hunks)
🧰 Additional context used
🧬 Code graph analysis (2)
Sources/UIViewKit/UIViewDSL/UIViewDSL+NSLayoutConstraint.swift (1)
Sources/UIViewKit/UIViewDSL/UIViewDSL+IBArrayOfNSLayoutConstraintBuilder.swift (1)
buildBlock(10-44)
Sources/UIViewKit/UIViewDSL/UIViewDSL+IBSubviews.swift (1)
Sources/UIViewKit/UIViewDSL/UIViewDSL+Engine.swift (3)
addSubviews(25-29)addSubviews(31-35)addSubviews(73-83)
🔇 Additional comments (5)
Sources/UIViewKit/UIViewDSL/ResultBuilder/UIViewDSL+AutoLayoutBuilder.swift (1)
2-2: LGTM! Clear naming improvement.The rename from
IBArrayOfNSLayoutConstraintBuildertoAutoLayoutBuilderfollows SwiftUI conventions and is much more concise and memorable.Also applies to: 11-11
Sources/UIViewKit/UIViewDSL/ResultBuilder/UIViewDSL+UIViewBuilder.swift (1)
2-2: LGTM! Excellent naming improvement.The rename from
IBArrayOfUIViewBuildertoUIViewBuilderis significantly clearer and aligns perfectly with SwiftUI's@ViewBuilderpattern.Also applies to: 11-11
Sources/UIViewKit/UIViewDSL/UIViewDSL+IBAttributes.swift (1)
13-13: LGTM! Usage updated correctly.The builder attribute has been updated to use the new
@AutoLayoutBuildername, maintaining consistency with the renamed builder type.Sources/UIViewKit/UIViewDSL/UIViewDSL+NSLayoutConstraint.swift (1)
12-12: LGTM! Usage updated correctly.The builder attribute has been updated to use the new
@AutoLayoutBuildername, maintaining consistency with the renamed builder type.Sources/UIViewKit/UIViewDSL/UIViewDSL+IBSubviews.swift (1)
13-13: LGTM! Both overloads updated correctly.The builder attribute has been updated to use the new
@UIViewBuildername in bothibSubviewsoverloads, maintaining consistency with the renamed builder type.Also applies to: 19-19
Thanks for using CodeRabbit! It's free for OSS, and your support helps us grow. If you like it, consider giving us a shout-out.
Comment @coderabbitai help to get the list of available commands and usage tips.
@coderabbitai help
Chat
There are 3 ways to chat with CodeRabbit:
- Review comments: Directly reply to a review comment made by CodeRabbit. Example:
I pushed a fix in commit <commit_id>, please review it.Open a follow-up GitHub issue for this discussion.
- Files and specific lines of code (under the "Files changed" tab): Tag
@coderabbitaiin a new review comment at the desired location with your query. - PR comments: Tag
@coderabbitaiin a new PR comment to ask questions about the PR branch. For the best results, please provide a very specific query, as very limited context is provided in this mode. Examples:@coderabbitai gather interesting stats about this repository and render them as a table. Additionally, render a pie chart showing the language distribution in the codebase.@coderabbitai read the files in the src/scheduler package and generate a class diagram using mermaid and a README in the markdown format.
CodeRabbit commands
These commands are invoked using PR/Issue comments.
@coderabbitai pauseto pause the reviews on a PR.@coderabbitai resumeto resume the paused reviews.@coderabbitai reviewto trigger an incremental review. This is useful when automatic reviews are disabled for the repository.@coderabbitai full reviewto do a full review from scratch and review all the files again.@coderabbitai summaryto regenerate the summary of the PR.@coderabbitai evaluate custom pre-merge check --instructions <custom-checks-instructions> --name <custom-checks-title> [--mode <error|warning>]to validate the custom pre-merge checks instructions. Defaults toerrorwhen--modeis omitted.@coderabbitai ignore pre-merge checksto override pre-merge checks and get an approval on PR.@coderabbitai run pre-merge checksto run pre-merge checks on the pull request.
@coderabbitai generate docstringsto generate docstrings for this PR.@coderabbitai generate sequence diagramto generate a sequence diagram of the changes in this PR.@coderabbitai generate unit teststo generate unit tests for this PR.@coderabbitai resolveto resolve all the CodeRabbit review comments.@coderabbitai configurationto show the current CodeRabbit configuration for the repository.@coderabbitai helpto get help.
Other keywords and placeholders
- Add
@coderabbitai ignoreor@coderabbit ignoreanywhere in the PR description to prevent this PR from being reviewed. - Add
@coderabbitai summaryto generate the high-level summary at a specific location in the PR description. - Add
@coderabbitaianywhere in the PR title to generate the title automatically.
CodeRabbit configuration file (.coderabbit.yaml)
- You can programmatically configure CodeRabbit by adding a
.coderabbit.yamlfile to the root of your repository. - Please see the configuration documentation for more information.
- You can also validate your configuration using the online YAML validator.
- If your editor has YAML language server enabled, you can add the path at the top of this file to enable auto-completion and validation:
# yaml-language-server: $schema=https://coderabbit.ai/integrations/schema.v2.json
Status, support, documentation and community
- Visit our status page to check the current availability of CodeRabbit.
- Create a ticket on our support page for assistance with any issues or questions.
- Visit our documentation site for detailed information on how to use CodeRabbit.
- Join our Discord community to connect with other users and get help from the community.
- Follow us on X/Twitter for updates and announcements.
@coderabbitai pause
@coderabbitai ignore
✅ Actions performed
Reviews paused.
✅ Actions performed
Reviews paused.