From 690b70632c266652aa8a7f3a054c52104280a2e0 Mon Sep 17 00:00:00 2001 From: Shunzhe MszPro Date: Thu, 2 Feb 2023 17:54:00 +0900 Subject: [PATCH] Fixed issue with empty SF Symbol name --- Sources/SwiftUILibrary/TagView.swift | 8 +++++++- 1 file changed, 7 insertions(+), 1 deletion(-) diff --git a/Sources/SwiftUILibrary/TagView.swift b/Sources/SwiftUILibrary/TagView.swift index 1b77d19..8dde4f4 100644 --- a/Sources/SwiftUILibrary/TagView.swift +++ b/Sources/SwiftUILibrary/TagView.swift @@ -42,7 +42,13 @@ public struct TagView: View { self.sfSymbolImageName = sfSymbolImageName } public var body: some View { - Label(tagContent, systemImage: sfSymbolImageName) + Group { + if sfSymbolImageName.isEmpty { + Text(tagContent) + } else { + Label(tagContent, systemImage: sfSymbolImageName) + } + } .font(textFont) .foregroundColor((tagStyle == .borderedProminent) ? .white : tagBackgroundColor) .padding(textPadding)