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

自定义解析依赖其他的属性怎么处理呀? #18

Closed
kellenyangs opened this issue Sep 11, 2023 · 1 comment
Closed

自定义解析依赖其他的属性怎么处理呀? #18

kellenyangs opened this issue Sep 11, 2023 · 1 comment

Comments

@kellenyangs
Copy link

struct Article {
@codec var type: String?
@codec var title: String?
@codec var info: Info?
@codec var desc: String?
@codec var createAt: String?
}

比如 info 的内容取决于 type的类型

@winddpan
Copy link
Owner

本库只是Codable Encode/Decode一个中转处理层,没有添加额外能力。
这个例子你可以使用计算属性。
建议先了解Codable后再使用本库。

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