Repository navigation
Fix Xcode 27 warnings in SwiftUI App template - #68
Merged
Merged
Conversation
Swift 6.4 warns when a nested closure captures a value weakly while the enclosing @ViewBuilder closure captures it strongly by implication (#ImplicitStrongCapture). Assign the capture explicitly to silence it. Enable INFOPLIST_KEY_UILaunchScreen_Generation, as Apple's own SwiftUI App template does, so generated projects run full screen without a manual Info.plist edit, and drop the #warning that asked for it. Co-Authored-By: Claude Fable 5.1 <noreply@anthropic.com>
A project created from the template had 18 files rewritten by the SwiftFormat phase and 2 more by swiftlint --fix on the first build. Apply the same formatting to the template sources so the first build changes nothing. - Use Apple's //___FILEHEADER___ form; the two-space variant expanded to a first header line with trailing whitespace in every file. - Remove redundant self, unused argument names, empty-body line breaks, indent #if DEBUG blocks, implicit returns, sorted imports. - MARK comments without dash, trailing closures, StateInfoConfig init with defaulted parameters last (project SwiftLint rules). Co-Authored-By: Claude Fable 5.1 <noreply@anthropic.com>
There was a problem hiding this comment.
🟢 Approval recommended
The changes are template-focused, compile-safe formatting/warning fixes with no functional logic regressions identified in the updated template sources.
Pull request overview
Updates the SwiftUI App (and related) Xcode templates to match Apple’s current template defaults and the repo’s formatting/linting rules, reducing first-build churn and silencing new Xcode/Swift warnings in generated projects.
Changes:
- Silence Swift 6.4 implicit strong capture warning in the template
ExampleFlowCoordinatorby explicitly binding a weak capture ([weak instance = instance]). - Enable automatic launch screen generation via
INFOPLIST_KEY_UILaunchScreen_Generationand remove the template warning instructing manualUILaunchScreensetup. - Apply consistent SwiftFormat/SwiftLint-driven formatting across template sources (including switching to
//___FILEHEADER___).
File summaries
| File | Description |
|---|---|
| Templates/Tab Coordinator.xctemplate/___VARIABLE_tabCoordinatorIdentifier___TabCoordinator.swift | Aligns header + removes unnecessary @ViewBuilder attribute on rootView. |
| Templates/SwiftUI App.xctemplate/TemplateInfo.plist | Enables INFOPLIST_KEY_UILaunchScreen_Generation=YES in template shared settings. |
| Templates/SwiftUI App.xctemplate/StateInfoView.swift | Reorders config init usage and reformats previews/action initializers. |
| Templates/SwiftUI App.xctemplate/StateInfoConfig.swift | Reorders initializer parameters to place title first and formats header. |
| Templates/SwiftUI App.xctemplate/Mockable.swift | Normalizes file header formatting. |
| Templates/SwiftUI App.xctemplate/ItemStateView.swift | Formatting-only tweaks (property assignment style, headers). |
| Templates/SwiftUI App.xctemplate/ItemState.swift | Normalizes file header formatting. |
| Templates/SwiftUI App.xctemplate/ExampleFlowCoordinator.swift | Fixes implicit strong capture warning by explicitly binding a weak capture. |
| Templates/SwiftUI App.xctemplate/ExampleComponentModel.swift | Formatting cleanup (blank line removal, preview mock indentation). |
| Templates/SwiftUI App.xctemplate/ExampleComponent.swift | Preview formatting and header normalization. |
| Templates/SwiftUI App.xctemplate/ExampleCacheProjection.swift | Header normalization. |
| Templates/SwiftUI App.xctemplate/DataCacheModel.swift | Converts section comment to doc comment and normalizes header. |
| Templates/SwiftUI App.xctemplate/Container.swift | Formatting-only (self. removal) and header normalization. |
| Templates/SwiftUI App.xctemplate/ComponentStateView.swift | MARK formatting + minor initializer callsite formatting (incl. trailing closure). |
| Templates/SwiftUI App.xctemplate/ComponentState.swift | Formatting-only (expanded if case, shorthand returns) and header normalization. |
| Templates/SwiftUI App.xctemplate/CacheProjection.swift | Avoids unused-parameter warnings by using _ names in default impl. |
| Templates/SwiftUI App.xctemplate/AppDelegate.swift | Avoids unused parameter warning (_: UIApplication) and formatting. |
| Templates/SwiftUI App.xctemplate/AppCoordinator.swift | Avoids unused parameter warning (with _:) and formatting. |
| Templates/SwiftUI App.xctemplate/App.swift | Removes obsolete UILaunchScreen warning, keeps build-phase reorder warning, formatting cleanup. |
| Templates/Service.xctemplate/VARIABLE_serviceIdentifier.swift | Compacts empty protocol/class bodies and normalizes header. |
| Templates/SceneFlowProvider.xctemplate/___VARIABLE_sceneFlowProviderIdentifier___SceneFlowProvider.swift | Comment indentation/formatting and header normalization. |
| Templates/Scene.xctemplate/Scene/VARIABLE_sceneIdentifier/___VARIABLE_sceneIdentifier___ComponentModel.swift | Formatting cleanup (blank line removal, preview mock indentation). |
| Templates/Scene.xctemplate/Scene/VARIABLE_sceneIdentifier/___VARIABLE_sceneIdentifier___Component.swift | Preview formatting and header normalization. |
| Templates/Scene.xctemplate/Resource Scene/VARIABLE_sceneIdentifier/___VARIABLE_sceneIdentifier___Resource.swift | Compacts empty protocol/struct bodies and normalizes header. |
| Templates/Scene.xctemplate/Resource Scene/VARIABLE_sceneIdentifier/___VARIABLE_sceneIdentifier___ComponentModel.swift | Formatting cleanup (blank line removal, preview mock indentation). |
| Templates/Scene.xctemplate/Resource Scene/VARIABLE_sceneIdentifier/___VARIABLE_sceneIdentifier___Component.swift | Preview formatting and header normalization. |
| Templates/Scene.xctemplate/Projection Scene/VARIABLE_sceneIdentifier/___VARIABLE_sceneIdentifier___ComponentModel.swift | Formatting cleanup (blank line removal, preview mock indentation). |
| Templates/Scene.xctemplate/Projection Scene/VARIABLE_sceneIdentifier/___VARIABLE_sceneIdentifier___Component.swift | Preview formatting and header normalization. |
| Templates/Scene.xctemplate/Projection Scene/VARIABLE_sceneIdentifier/___VARIABLE_sceneIdentifier___CacheProjection.swift | Avoids unused-parameter warnings (from _) and normalizes header. |
| Templates/Flow Coordinator.xctemplate/___VARIABLE_flowCoordinatorIdentifier___FlowCoordinator.swift | Header normalization. |
Review details
- Files reviewed: 21/30 changed files
- Comments generated: 0
- Review effort level: Lite
💡 Add a code-review agent skill or configure MCP servers for context-aware, tailored reviews. Learn more in the docs.
Co-Authored-By: Claude Fable 5.1 <noreply@anthropic.com>
ssestak
approved these changes
Sep 7, 2026
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Add this suggestion to a batch that can be applied as a single commit.This suggestion is invalid because no changes were made to the code.Suggestions cannot be applied while the pull request is closed.Suggestions cannot be applied while viewing a subset of changes.Only one suggestion per line can be applied in a batch.Add this suggestion to a batch that can be applied as a single commit.Applying suggestions on deleted lines is not supported.You must change the existing code in this line in order to create a valid suggestion.Outdated suggestions cannot be applied.This suggestion has been applied or marked resolved.Suggestions cannot be applied from pending reviews.Suggestions cannot be applied on multi-line comments.Suggestions cannot be applied while the pull request is queued to merge.Suggestion cannot be applied right now. Please check back later.
[weak instance = instance]) to silence the Swift 6.4#ImplicitStrongCapturewarning inExampleFlowCoordinator.INFOPLIST_KEY_UILaunchScreen_Generation, as Apple's SwiftUI App template does, and drop the#warningasking to addUILaunchScreenmanually..swiftformat/.swiftlint.ymland switch to Apple's//___FILEHEADER___form, so the first build of a generated project no longer rewrites 20 files. Verified by generating a project, linking FuturedKit locally and building with Xcode 27: build succeeds, the only compiler warning is the intended build-phase reorder#warning.