Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

[fix] View environment customizations on hosting VCs now propagate to SwiftUI environment #297

Merged
merged 2 commits into from
Aug 22, 2024

Conversation

robmaceachern
Copy link
Member

  • View environment customizations on hosting VCs now propagate to SwiftUI environment
  • ModeledHostingController implementations now conform to ViewEnvironmentObserving
  • Added tests

These changes ensure that any view environment customizations made to a Swift UI screen's backing VC are propagated to the SwiftUI environment. We hit this issue in Market when attempting to propagate the VC's navigation item to SwiftUI and there may be other uses for this behaviour too.

Checklist

  • Unit Tests
  • UI Tests
  • Snapshot Tests (iOS only)
  • I have made corresponding changes to the documentation

@robmaceachern robmaceachern marked this pull request as ready for review August 22, 2024 14:17
@robmaceachern robmaceachern requested review from a team as code owners August 22, 2024 14:17
@robmaceachern robmaceachern force-pushed the robmaceachern/hosting-controller-env-obs branch from 1291827 to 38e6320 Compare August 22, 2024 14:35
import ViewEnvironment
@_spi(ViewEnvironmentWiring) import ViewEnvironmentUI
import XCTest
@testable import WorkflowSwiftUI
Copy link
Member Author

Choose a reason for hiding this comment

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

@watt The @testable was required here because the StateAccessor init is not public. Not sure if that was intentional or not. I can open it up as part of this if you'd like!

Copy link
Collaborator

Choose a reason for hiding this comment

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

hmm, probably OK if it's public.

Copy link
Member Author

Choose a reason for hiding this comment

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

👍🏽 46961b0

import ViewEnvironment
@_spi(ViewEnvironmentWiring) import ViewEnvironmentUI
import XCTest
@testable import WorkflowSwiftUI
Copy link
Collaborator

Choose a reason for hiding this comment

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

hmm, probably OK if it's public.

@robmaceachern robmaceachern enabled auto-merge (squash) August 22, 2024 22:12
@robmaceachern robmaceachern merged commit 3495af0 into main Aug 22, 2024
14 checks passed
@robmaceachern robmaceachern deleted the robmaceachern/hosting-controller-env-obs branch August 22, 2024 22:25
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.

3 participants