Skip to content

Modernize Swift codelab - #248

Merged
morganchen12 merged 11 commits into
masterfrom
mc/modernize
Aug 28, 2026
Merged

Modernize Swift codelab#248
morganchen12 merged 11 commits into
masterfrom
mc/modernize

Conversation

@morganchen12

@morganchen12 morganchen12 commented Jul 31, 2026

Copy link
Copy Markdown
Contributor

Googlers see cl/970865318

@wiz-9635d3485b

wiz-9635d3485b Bot commented Jul 31, 2026

Copy link
Copy Markdown

Wiz Scan Summary

Scanner Findings
Vulnerability Finding Vulnerabilities -
Data Finding Sensitive Data -
Secret Finding Secrets -
IaC Misconfiguration IaC Misconfigurations -
SAST Finding SAST Findings 1 Info
Software Management Finding Software Management Findings -
Total 1 Info

View scan details in Wiz

To detect these findings earlier in the dev lifecycle, try the Wiz Code extension for VS Code, JetBrains, or Visual Studio.

@morganchen12
morganchen12 requested a review from peterfriese July 31, 2026 20:41

@gemini-code-assist gemini-code-assist Bot left a comment

Copy link
Copy Markdown

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

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.

Comment thread ios/swift/FriendlyChatSwift/Views/FriendlyMessageImageView.swift
Comment thread ios/swift/FriendlyChatSwift/Views/ContentView.swift Outdated
Comment thread ios/swift/FriendlyChatSwift/Views/LoginView.swift Outdated
Comment thread ios/swift/FriendlyChatSwift/Views/SignUpView.swift Outdated
Comment thread ios/swift/FriendlyChatSwift/ViewModels/FriendlyMessageViewModel.swift Outdated
Comment thread test.sh
Comment thread test.sh Outdated
@morganchen12
morganchen12 removed the request for review from peterfriese July 31, 2026 20:43
@peterfriese

peterfriese commented Jul 31, 2026

Copy link
Copy Markdown

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

@morganchen12

Copy link
Copy Markdown
Contributor Author

/gemini review

@gemini-code-assist gemini-code-assist Bot left a comment

Copy link
Copy Markdown

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

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.

Comment thread ios/swift/FriendlyChatSwift/Views/ContentView.swift
Comment thread ios/swift/FriendlyChatSwift/Views/ProfileView.swift
Comment thread ios/swift/FriendlyChatSwift/Views/SignUpView.swift
Comment thread ios/swift/FriendlyChatSwift/Views/FooterView.swift
Comment thread ios/swift/FriendlyChatSwift/Views/FriendlyMessageImageView.swift
Comment thread ios/swift/FriendlyChatSwift/ViewModels/FriendlyMessageViewModel.swift Outdated
@morganchen12

Copy link
Copy Markdown
Contributor Author

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 @MainActor).

@morganchen12
morganchen12 merged commit c52f689 into master Aug 28, 2026
14 checks passed
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

2 participants