-
Notifications
You must be signed in to change notification settings - Fork 10
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
Strictly typed form row #5
Comments
Thanks for your interest! I'm definitely open to revamping the types. I started this project before I really internalized swift's type system the power and purpose of protocols. The part of this library I like the most is the general shape of the interface, declaratively creating a form, compliance validations... Everything under the hood has a lot of room for improvement. I erred on the side of more flexibility when I started and that over-complicated things. I think it's time to restrict the interface, make it clean and useful, and maybe reintroduce flexibility as needed. |
@tp I'm interested in seeing a brief proposal 👓 of how you think this should be accomplished. Or maybe my break-out of |
I had a stab yesterday at trying new protocols that would allow for strictly typed rows, but I was not able to define a protocol with generic types, that classes could implement as Maybe my thinking was wrong and not aligned with Swift or it is not yet possible in 1.2. Definitely need to look further into this. |
I think the trouble is going to be that it can't be a generic row with heterogenous associated types, while also keeping a strongly-typed collection of those rows 😞 I've considered using an enum with associated types, but then that really cuts down on extensibility from outside the library. I think we'll need to tinker with possible structures to see if we can come up with anything. |
Hi,
really liking the ease and clarity of most his project :-)
While using protocols is great in principle, in practice a lot of the rows are
ConcreteFormRow
instances and therefore not super strictly type (for example Action = (AnyObject?) -> Void).Would you be open to discuss more specific row types?
They would probably just end up being FormRow, but then allow for event stricter code.
The text was updated successfully, but these errors were encountered: