Skip to content

Ignoring computed fields in @Selection #96

Answered by mbrandonw
thinkpractice asked this question in Q&A
Discussion options

You must be logged in to vote

Hi @thinkpractice, is weightInLocalUnit really that expensive? That would be surprising to me if it's just a simple computation to convert units.

If you really want to do this you can always inline the code that the @Selection macro writes and modify the init(decoder:) to compute weight after the other fields have been decoded.

Replies: 2 comments 3 replies

Comment options

You must be logged in to vote
0 replies
Answer selected by thinkpractice
Comment options

You must be logged in to vote
3 replies
@mbrandonw
Comment options

@thinkpractice
Comment options

@mbrandonw
Comment options

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Category
Q&A
Labels
None yet
2 participants