Modernize Swift codelab - #248
Conversation
Wiz Scan Summary
To detect these findings earlier in the dev lifecycle, try the Wiz Code extension for VS Code, JetBrains, or Visual Studio. |
There was a problem hiding this comment.
Code Review
This pull request modernizes the FriendlyChat iOS codelab by migrating the Swift starter and completed projects from UIKit, Storyboards, and CocoaPods to SwiftUI, Swift Package Manager, and Firebase iOS SDK v12+. Key changes include the removal of legacy view controllers and storyboards, the introduction of SwiftUI views and modern MVVM view models, and updates to the test script. The review feedback highlights several areas for improvement, including handling Google Storage URIs in image loading, preventing out-of-bounds scrolling when messages are empty, replacing deprecated text modifiers, ensuring thread safety for main-actor-isolated state mutations in database observers, and using bash arrays in the test script to avoid word-splitting bugs.
|
Apart from my comment about Observation, I'd recommend installing the following skills for up-to-date SwiftUI / Swift Concurrency / view design insights:
and/or using the Xcode 27 skills |
|
/gemini review |
There was a problem hiding this comment.
Code Review
This pull request migrates the FriendlyChat iOS sample application from a legacy UIKit and CocoaPods setup to a modern SwiftUI architecture using Swift Package Manager and Swift Concurrency. The feedback focuses on resolving several critical Swift Concurrency issues under strict concurrency checks. Specifically, the reviewer recommends marking multiple SwiftUI views (such as ContentView, ProfileView, SignUpView, FooterView, and FriendlyMessageImageView) with @mainactor to ensure safe UI state mutations and actor-isolated instantiations. Additionally, the reviewer suggests refactoring the Firebase Database observer in FriendlyMessageViewModel to prevent capturing a non-Sendable main-actor-isolated self inside a non-isolated escaping closure.
|
Updated with SwiftUI skills and resolved gemini code review comments since they're incorrect (build did not produce errors, View does not need to be annotated with |
Googlers see cl/970865318