@@ -132,7 +132,11 @@ extension MainTabBarController {
132132//
133133extension MainTabBarController {
134134
135- func showDotOn( _ tab: WooTab ) {
135+ static func showDotOn( _ tab: WooTab ) {
136+ guard let tabBar = AppDelegate . shared. tabBarController? . tabBar else {
137+ return
138+ }
139+
136140 hideDotOn ( tab)
137141 let dot = GreenDotView ( frame: CGRect ( x: DotConstants . xOffset,
138142 y: DotConstants . yOffset,
@@ -142,7 +146,11 @@ extension MainTabBarController {
142146 tabBar. subviews [ tab. rawValue] . subviews. first? . insertSubview ( dot, at: 1 )
143147 }
144148
145- func hideDotOn( _ tab: WooTab ) {
149+ static func hideDotOn( _ tab: WooTab ) {
150+ guard let tabBar = AppDelegate . shared. tabBarController? . tabBar else {
151+ return
152+ }
153+
146154 let tag = dotTag ( for: tab)
147155 if let subviews = tabBar. subviews [ tab. rawValue] . subviews. first? . subviews {
148156 for subview in subviews where subview. tag == tag {
@@ -151,7 +159,7 @@ extension MainTabBarController {
151159 }
152160 }
153161
154- private func dotTag( for tab: WooTab ) -> Int {
162+ private static func dotTag( for tab: WooTab ) -> Int {
155163 return tab. rawValue + DotConstants. tagOffset
156164 }
157165}
@@ -193,7 +201,7 @@ private class GreenDotView: UIView {
193201 }
194202
195203 private func setupSubviews( ) {
196- self . backgroundColor = . clear
204+ backgroundColor = . clear
197205 }
198206
199207 override func draw( _ rect: CGRect ) {
0 commit comments