Parsing to/from a Tagged value #69
Unanswered
oliverfoggin
asked this question in
Q&A
Replies: 1 comment 3 replies
-
Ooh... ok, possibly got a bit further now. I've managed to get this building...
It feels like that's not as good as it could be though. 😄 |
Beta Was this translation helpful? Give feedback.
3 replies
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
-
I'm trying to introduce the
Tagged
framework into our project and just doing a PoC now.I have a struct like...
and a route...
Something like this anyway.
My Router at the moment is able to parse this well and embed the
id
from theItem
into the url so you end up with a path like...I'm putting the id into the path using a simple ParserPrinter like...
But now I'd like to update this to make Item like...
I've got these changes into the app except now I'm not sure how to update the Router ParserPrinter to accept this
Item.Id
instead of just String.I've tried like...
But that didn't work. It told me
Initializer 'init(_:with:)' requires that <LONG NESTED PARSER NAME> conforms to ParserPrinter
.I also tried using the
Parse(_ transform, with: )
init too with the same error (pretty much).Please could someone advise on how to do this?
Thanks
Beta Was this translation helpful? Give feedback.
All reactions