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

kindの値をenumか何かにできませんか #12

Open
Enchan1207 opened this issue Apr 5, 2021 · 3 comments
Open

kindの値をenumか何かにできませんか #12

Enchan1207 opened this issue Apr 5, 2021 · 3 comments

Comments

@Enchan1207
Copy link
Owner

searchエンドポイントとか叩く時にSearchResourceのkindで振り分けなきゃいけないんですが
searchResults.filter({$0.kind == "youtube#video"})なんて書きたくない

@Enchan1207
Copy link
Owner Author

init?(rawValue: String)でallcases回さなきゃいけないのがめんどくせえんだよなあ
パターンに合致しない要素のために.others(_ value: String)も用意しなきゃならんし…

@Enchan1207
Copy link
Owner Author

collectionresourceまで含めると結構パターン多くてめんどくさいっすね(とりあえずother()で逃げますが)

@Enchan1207
Copy link
Owner Author

無理!Serializableに準拠できなくなる

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

1 participant