         }
         
         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() {

            textLabel.textColor = item.textColor
            textLabel.font =  UIFont.systemFont(ofSize: item.textFontSize)
            textLabel.textAlignment = NSTextAlignment.center

            container.backgroundColor = (items as [RAMAnimatedTabBarItem])[index].bgDefaultColor

            container.addSubview(icon)
            let itemSize = item.image?.size ?? CGSize(width: 30, height: 30)
            //createConstraints(icon, container: container, size: itemSize, yOffset: -5 - item.yOffSet)

            container.addSubview(textLabel)
            let textLabelWidth = tabBar.frame.size.width / CGFloat(items.count) - 5.0
            //createConstraints(textLabel, container: container, width: textLabelWidth, yOffset: 16 - item.yOffSet, heightRelation: .greaterThanOrEqual)

            if item.isEnabled == false {
                icon.alpha = 0.5
                textLabel.alpha = 0.5

            return
        }

        if selectedIndex != currentIndex {
            let previousItem = items.at(selectedIndex)
            let previousContainer: UIView? = previousItem?.iconView?.icon.superview
            previousContainer?.backgroundColor = items[selectedIndex].bgDefaultColor
            previousItem?.deselectAnimation()

            let currentItem: RAMAnimatedTabBarItem = items[currentIndex]
            currentItem.playAnimation()
            let currentContainer: UIView? = currentItem.iconView?.icon.superview
            currentContainer?.backgroundColor = items[currentIndex].bgSelectedColor

            selectedIndex = index
        } else {
            if let navVC = viewControllers?[selectedIndex] as? UINavigationController {
                navVC.popToRootViewController(animated: true)
            }
        }
