Skip to content

[Xcode 27] Capture state as weak before any uses#2271

Merged
eschwieb merged 3 commits into
mainfrom
user/eriksc/xcode27_weak_state
Jun 9, 2026
Merged

[Xcode 27] Capture state as weak before any uses#2271
eschwieb merged 3 commits into
mainfrom
user/eriksc/xcode27_weak_state

Conversation

@eschwieb

@eschwieb eschwieb commented Jun 9, 2026

Copy link
Copy Markdown
Contributor

The code was capturing state as weak after already using it, and Xcode 27 now complains of the mixed strong and weak usage. Move the capture up to the HStack itself rather than in the ForEach of the stack's buttons, and use it appropriately inside.

Platforms Impacted

  • iOS
  • visionOS
  • macOS

Description of changes

(a summary of the changes made, often organized by file)

Binary change

(how is our binary size impacted -- see https://github.com/microsoft/fluentui-apple/wiki/Size-Comparison)

Verification

(how the change was tested, including both manual and automated tests)

Visual Verification
Before After
Screenshot or description before this change Screenshot or description with this change

Pull request checklist

This PR has considered:

  • Light and Dark appearances
  • iOS supported versions (all major versions greater than or equal current target deployment version)
  • VoiceOver and Keyboard Accessibility
  • Internationalization and Right to Left layouts
  • Different resolutions (1x, 2x, 3x)
  • Size classes and window sizes (iPhone vs iPad, notched devices, multitasking, different window sizes, etc)
  • iPad Pointer interaction
  • SwiftUI consumption (validation or new demo scenarios needed)
  • Objective-C exposure (provide it only if needed)
Microsoft Reviewers: Open in CodeFlow

The code was capturing state as weak after already using it, and Xcode 27 now complains of the mixed strong and weak usage. Move the capture up to the HStack itself rather than in the ForEach of the stack's buttons, and use it appropriately inside.
@eschwieb eschwieb requested a review from a team as a code owner June 9, 2026 01:20
@eschwieb eschwieb enabled auto-merge (squash) June 9, 2026 17:58
@eschwieb eschwieb merged commit 2ebc546 into main Jun 9, 2026
10 checks passed
@eschwieb eschwieb deleted the user/eriksc/xcode27_weak_state branch June 9, 2026 19:54
@joannaquu joannaquu mentioned this pull request Jul 9, 2026
12 tasks
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.

4 participants