File tree Expand file tree Collapse file tree 1 file changed +6
-3
lines changed
WooCommerce/Classes/ViewRelated Expand file tree Collapse file tree 1 file changed +6
-3
lines changed Original file line number Diff line number Diff line change @@ -134,25 +134,28 @@ extension MainTabBarController {
134134
135135 func showDotOn( _ tab: WooTab ) {
136136 hideDotOn ( tab)
137- let tag = tab. rawValue + DotConstants. tagOffset
138137 let dot = UIView ( frame: CGRect ( x: DotConstants . xOffset,
139138 y: DotConstants . yOffset,
140139 width: DotConstants . diameter,
141140 height: DotConstants . diameter) )
142- dot. tag = tag
141+ dot. tag = dotTag ( for : tab )
143142 dot. backgroundColor = StyleManager . wooAccent
144143 dot. layer. cornerRadius = ( DotConstants . diameter / 2 )
145144 tabBar. subviews [ tab. rawValue] . subviews. first? . insertSubview ( dot, at: 1 )
146145 }
147146
148147 func hideDotOn( _ tab: WooTab ) {
149- let tag = tab . rawValue + DotConstants . tagOffset
148+ let tag = dotTag ( for : tab )
150149 if let subviews = tabBar. subviews [ tab. rawValue] . subviews. first? . subviews {
151150 for subview in subviews where subview. tag == tag {
152151 subview. removeFromSuperview ( )
153152 }
154153 }
155154 }
155+
156+ private func dotTag( for tab: WooTab ) -> Int {
157+ return tab. rawValue + DotConstants. tagOffset
158+ }
156159}
157160
158161
You can’t perform that action at this time.
0 commit comments