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

Regression: UIKitIntrospectionViewController doesn't handle state updates #194

Closed
chwo opened this issue Feb 15, 2023 · 5 comments
Closed

Comments

@chwo
Copy link

chwo commented Feb 15, 2023

Description

  • The behaviour of the UIKitIntrospectionViewController was changed in version 0.2.0 Fix view controller introspection #165
  • Previously (version 0.1.4), the customize handler was called in the updateUIViewController so it was called on state changes
  • Now, the customize handler is only called in makeUIViewController so it is only called with the initial state and isn't called on state changes

Use case

We use introspectSearchController to introspect a SwiftUI List with the searchable modifier and want to configure properties of the searchController based on the state (if the list is empty or not). So the customize handler needs to be called again if the state (the list entries) changes.

@davdroman
Copy link
Collaborator

Great point. Okay so the fix should be to call the customize callback in updateViewController also. Will make a PR shortly.

davdroman added a commit that referenced this issue Feb 15, 2023
Co-authored-by: David Roman <2538074+davdroman@users.noreply.github.com>
@davdroman
Copy link
Collaborator

@chwo this is now fixed in 0.2.1. Please update and let me know if it works for you.

@davdroman
Copy link
Collaborator

davdroman commented Feb 15, 2023

I'm afraid #192 didn't fix this for some reason. I'm currently investigating why.

@davdroman davdroman mentioned this issue Feb 15, 2023
davdroman added a commit that referenced this issue Feb 15, 2023
This actually fixes the regression in #194. My bad for not checking
better. A good area of improvement for automated tests.
@davdroman
Copy link
Collaborator

This is now actually fixed in 0.2.2, I tested it with one of my libraries which broke with 0.2.0. Closing for now but feel free to reopen if you experience this issue again.

@chwo
Copy link
Author

chwo commented Feb 16, 2023

@davdroman I have tested it and it works again in 0.2.2. Thank you for the fast fix. 🙌

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