Skip to content

Fix build on Xcode 27 beta 2#4595

Merged
kean merged 1 commit into
trunkfrom
kean/horizontal-carousel-init-order
Jun 26, 2026
Merged

Fix build on Xcode 27 beta 2#4595
kean merged 1 commit into
trunkfrom
kean/horizontal-carousel-init-order

Conversation

@kean

@kean kean commented Jun 23, 2026

Copy link
Copy Markdown
Contributor
📘 Part of: #

Reorders property initialization in HorizontalCarousel.init. visibleIndex is a @State property, so assigning it via self.visibleIndex = … goes through the wrapped-value setter, which references self and therefore requires all stored properties to be initialized first. The assignment previously ran before items and content were set; it's now moved to the end of init.

To test

  1. Open any screen that uses HorizontalCarousel (e.g. the onboarding/upsell carousels).
  2. Confirm it builds and the carousel renders, swipes between pages, and reports the correct current index.

Checklist

  • I have considered if this change warrants user-facing release notes and have added them to CHANGELOG.md if necessary.
  • I have considered adding unit tests for my changes.
  • I have updated (or requested that someone edit) the Event Horizon schema to reflect any new or changed analytics.

Assigning the @State-backed visibleIndex goes through its wrapped-value
setter (which references self), so it must run after the stored items and
content properties are initialized. Move the assignment to the end of init.

Co-Authored-By: Claude Opus 4.8 (1M context) <noreply@anthropic.com>
@kean kean requested a review from a team as a code owner June 23, 2026 16:46
@kean kean requested review from SergioEstevao and Copilot and removed request for a team June 23, 2026 16:46
@kean kean added this to the 8.15 milestone Jun 23, 2026
@kean kean added the [Type] Bug Used for issues where something is not functioning as intended. label Jun 23, 2026

Copilot AI left a comment

Copy link
Copy Markdown
Contributor

Choose a reason for hiding this comment

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

Copilot was unable to review this pull request because the user who requested the review has reached their quota limit.

@kean kean changed the title Fix HorizontalCarousel init order for @State visibleIndex Fix build on Xcode 27 beta 2 Jun 23, 2026
@kean kean added [Type] Other Issues not covered by other types, such as polish, refactoring and documentation. and removed [Type] Bug Used for issues where something is not functioning as intended. labels Jun 23, 2026
@kean kean modified the milestones: 8.15, Future Jun 23, 2026

@SergioEstevao SergioEstevao left a comment

Copy link
Copy Markdown
Contributor

Choose a reason for hiding this comment

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

Working correctly on Xcode 26 and 27. :shipit:

@kean kean merged commit 26515b0 into trunk Jun 26, 2026
8 of 11 checks passed
@kean kean deleted the kean/horizontal-carousel-init-order branch June 26, 2026 13:02
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

[Type] Other Issues not covered by other types, such as polish, refactoring and documentation.

Projects

None yet

Development

Successfully merging this pull request may close these issues.

3 participants