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

Propagate .options changes when SwiftUI View is updated #697

Closed
nfgrilo opened this issue Jan 26, 2024 · 3 comments
Closed

Propagate .options changes when SwiftUI View is updated #697

nfgrilo opened this issue Jan 26, 2024 · 3 comments

Comments

@nfgrilo
Copy link
Contributor

nfgrilo commented Jan 26, 2024

  • SwiftUI only
  • git branch: 4.0

Currently, when the View holding the PageView has changes and need refresh, PageView modifiers changes are not propagated to UIKit (but SwiftUI contents inside Page are 👍🏼).

My use case is that I support custom themes on my app, and everything is correctly updated except for the menu items.

I have attached three patches (4.0 branch):

  • one to demonstrate the issue/use case (changes are applied to DefaultView on ExampleSwiftUI target)
  • one to allow the propagation of .options via PagingControllerRepresentableView.updateUIViewController()
  • one to respect the .indicatorStyle() modifier (after propagating options)

0001-Added-changes-to-DefaultView-to-exemplify.patch
0002-Propagate-.options-modifiers-on-View-updates.patch
0003-Fixed-.indicatorStyle-not-being-respected.patch

I would be very grateful if you could give a try and have a look!

@nfgrilo
Copy link
Contributor Author

nfgrilo commented Jan 30, 2024

If you find useful, I can create a PR from my fork https://github.com/nfgrilo/Parchment/tree/4.0

@rechsteiner
Copy link
Owner

Thank you so much for the detailed issue and fix! I really appreciate it 🙌 The patches you provided look great. Feel free to create a PR from your fork, although we can probably skip the DefaultView changes.

@nfgrilo
Copy link
Contributor Author

nfgrilo commented Feb 17, 2024

Thanks! I've created a PR with a single commit here: #703

Great work ❤️

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

No branches or pull requests

2 participants