         }
         
         containers.forEach { $0.removeFromSuperview() }
-        containers = items.map { _ in
+        containers.removeAll()
+        
+        for index in 0 ..< items.count {
             let viewContainer = UIView()
+            viewContainer.isExclusiveTouch = true
+            viewContainer.tag = index
+            let tapGesture = UITapGestureRecognizer(target: self, action: #selector(itemTap))
+            viewContainer.addGestureRecognizer(tapGesture)
             tabBar.addSubview(viewContainer)
-            return viewContainer
+            containers.append(viewContainer)
+        }
+                
+        if !containers.isEmpty {
+            createCustomIcons(containers: containers)
         }
         
         layoutContainers()
-        
-        if !containers.isEmpty {
-            createCustomIcons(containers: containers)
-        }
     }
     
     private func layoutContainers() {

    }

    open override var selectedViewController: UIViewController? {
        didSet {
            guard let vc = selectedViewController,
                let index = viewControllers?.firstIndex(of: vc) else { return }
            handleSelection(index: index)
        }

            let renderMode = item.iconColor.cgColor.alpha == 0 ? UIImage.RenderingMode.alwaysOriginal :
                UIImage.RenderingMode.alwaysTemplate

            
            let iconImage = item.image ?? item.iconView?.icon.image
            let icon = UIImageView(image: iconImage?.withRenderingMode(renderMode))
            icon.tintColor = item.iconColor
            icon.highlightedImage = item.selectedImage?.withRenderingMode(renderMode)
            container.addSubview(icon)

            
            let textLabel = UILabel()
            if let title = item.title, !title.isEmpty {
                textLabel.text = title
