diff --git a/Zatch/Global/Source/Component/Tag/Tag.swift b/Zatch/Global/Source/Component/Tag/Tag.swift index f4bad6c1..b138509e 100644 --- a/Zatch/Global/Source/Component/Tag/Tag.swift +++ b/Zatch/Global/Source/Component/Tag/Tag.swift @@ -33,6 +33,11 @@ extension ZatchComponent{ class Tag: UILabel{ + var isDisabled = false{ + didSet{ + isDisabled ? setDisabledState() : setNormalState() + } + } var isSelected = false{ didSet{ isSelected ? setSelectState() : setNormalState() @@ -89,6 +94,11 @@ extension ZatchComponent{ self.backgroundColor = colorType.backgroundColor } + private func setDisabledState(){ + self.textColor = colorType.disabledTextColor + self.backgroundColor = colorType.disabledBackgroundColor + } + private func setSelectState(){ self.textColor = colorType.selectedTextColor self.backgroundColor = colorType.selectedBackgroundColor diff --git a/Zatch/Global/Source/Component/Tag/TagStlye.swift b/Zatch/Global/Source/Component/Tag/TagStlye.swift index 28f5fd59..e2dfc8eb 100644 --- a/Zatch/Global/Source/Component/Tag/TagStlye.swift +++ b/Zatch/Global/Source/Component/Tag/TagStlye.swift @@ -26,6 +26,8 @@ extension ZatchComponent.Tag.TagColor{ let backgroundColor: UIColor let selectedTextColor: UIColor = .white let selectedBackgroundColor: UIColor + let disabledTextColor: UIColor + let disabledBackgroundColor: UIColor } private var colorInfo: TagColorStyle{ @@ -33,11 +35,15 @@ extension ZatchComponent.Tag.TagColor{ case .purple: return TagColorStyle(textColor: .zatchPurple, backgroundColor: .purple40, - selectedBackgroundColor: .zatchPurple) + selectedBackgroundColor: .zatchPurple, + disabledTextColor: .black20, + disabledBackgroundColor: .black10) case .yellow: return TagColorStyle(textColor: .zatchDeepYellow, backgroundColor: .yellow40, - selectedBackgroundColor: .zatchDeepYellow) + selectedBackgroundColor: .zatchDeepYellow, + disabledTextColor: .black20, + disabledBackgroundColor: .black10) } } @@ -56,6 +62,14 @@ extension ZatchComponent.Tag.TagColor{ var selectedBackgroundColor: UIColor{ colorInfo.selectedBackgroundColor } + + var disabledTextColor: UIColor{ + colorInfo.disabledTextColor + } + + var disabledBackgroundColor: UIColor{ + colorInfo.disabledBackgroundColor + } } extension ZatchComponent.Tag.TagType{ diff --git a/Zatch/Resource/Storyboard/Base.lproj/Main.storyboard b/Zatch/Resource/Storyboard/Base.lproj/Main.storyboard index ef82bead..a7152c02 100644 --- a/Zatch/Resource/Storyboard/Base.lproj/Main.storyboard +++ b/Zatch/Resource/Storyboard/Base.lproj/Main.storyboard @@ -1,5 +1,5 @@ - + @@ -9,10 +9,10 @@ - + - + @@ -37,7 +37,7 @@ - +