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

New imageicon interface #132

Merged
merged 6 commits into from
Sep 20, 2023
Merged

New imageicon interface #132

merged 6 commits into from
Sep 20, 2023

Conversation

kevinneko
Copy link
Contributor

解決したいこと

Image(charcoalIcon: .add)のように画像を設定できるようにする

やったこと

複数の AssetGroup をフラット化しています

動作確認環境

iOS 13 - iOS 16

@kevinneko kevinneko requested a review from kvvzr September 19, 2023 09:49
{% elif asset.type == "symbol" %}
{{accessModifier}} static let {{asset.name|swiftIdentifier:"pretty"|lowerFirstWord|escapeReservedKeywords}} = {{symbolType}}(name: "{{asset.value}}")
{% elif asset.items and ( forceNamespaces == "true" or asset.isNamespaced == "true" ) %}
{{accessModifier}} enum {{asset.name|swiftIdentifier:"pretty"|escapeReservedKeywords}} {
{% filter indent:2," ",true %}{% call casesBlock asset.items %}{% endfilter %}
{{accessModifier}} enum {{asset.name|swiftIdentifier:"pretty"|escapeReservedKeywords}} : CaseIterable {
Copy link
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

ライブラリを使う側の人にとってはCaseIterableは不要だと思うので、ここでは削っていただけると 🙏
CaseIterableを付けたいと思ったのはSample側の話でした

Copy link
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

extensionでCaseIterableを書く場合、allCasesを自分で実装する必要があったため、やはりこの方針でいくのが良いとなった

@@ -148,7 +163,7 @@
{{accessModifier}} enum {{enumName}} {
{% if catalogs.count > 1 or param.forceFileNameEnum %}
{% for catalog in catalogs %}
{{accessModifier}} enum {{catalog.name|swiftIdentifier:"pretty"|escapeReservedKeywords}} {
{{accessModifier}} enum {{catalog.name|swiftIdentifier:"pretty"|escapeReservedKeywords}} : CaseIterable {
Copy link
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

ここもCaseIterable無くて大丈夫です

@kevinneko kevinneko merged commit 48a7407 into main Sep 20, 2023
@kevinneko kevinneko deleted the new-imageicon-interface branch September 20, 2023 05:16
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

Successfully merging this pull request may close these issues.

2 participants