-
Notifications
You must be signed in to change notification settings - Fork 87
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
Eliminate context property to improve type safety by making Row a protocol #23
Comments
I actually started down this route, but it got complicated quickly. The main reason is you can't make I thought Thoughts? cc @ayanonagon @hyperspacemark |
Why wouldn't Equatable work with RowType? Assuming you stick with just comparing UUID strings like the current implementation, I don't see a problem. And about separating concerns, the example I was thinking about would be a cell with three labels and a VM with three strings of text. Conceivably there could be many cells displaying those three strings depending on the context and the VM doesn't really need to know anything other than that it has three strings. I'll play around with this more as I have time. Thanks for the work so far! 😀 |
You can't equate a protocol. Try implementing it ;) Ya that's fair. I'd love to have this if you can make it work. Properties are better than context any day |
That's annoying! I wrote it out this morning as |
Yep. Makes sense though. Say you had a protocol like |
I played around with this idea a bit this morning but it isn't fully baked yet and I'm definitely not a Swift generics expert, but what do you think about this:
This would let users of Static define their own implementations of Row and then (this is the important part!) overload the
configure
method on their cell in an extension with their custom Row type and do everything in a type-safe manner within.Am I crazy or is this do-able?
The text was updated successfully, but these errors were encountered: