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

ANyView? #30

Open
kylebrowning opened this issue Jun 25, 2024 · 4 comments
Open

ANyView? #30

kylebrowning opened this issue Jun 25, 2024 · 4 comments

Comments

@kylebrowning
Copy link

Why is erasing to any view required? when I remove those erasures, the UI is no longer styled

@FulcrumOne
Copy link
Contributor

Hey @kylebrowning,

I'll start by answering the second question - the reason is that the protocols expect the function to return AnyView, so if you put any View in there, the protocol will simply use the default implementation of the function as there is a mismatch of types.

And now moving on to a more difficult question for me - it's embarrassing to admit, but I don't remember why I did that - I probably didn't want to put too many typealias in there, but I'm not sure 😅

I'm planning to come back to this library in about 1.5 months (I'm currently working on NavigationView, then there will be PopupView and then I'm releasing MediaPicker), so I promise to come back to this question then 😅

Thanks for your question and have a nice day!

@kylebrowning
Copy link
Author

Yeah unfortunately using AnyView breaks identity and is discouraged by Apple in most cases. :/.

@FulcrumOne
Copy link
Contributor

yeah, I know this breaks the view hierarchy on re-rendering and if that's the only reason I did it (not sure tho), then it's an obvious mistake. Anyways, I promise to come back here ASAP 😉

@kylebrowning
Copy link
Author

Thanks for the quick response. LMK if you need help.

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