         }
         for (idx, item) in items.enumerated() {
             if idx == index {
-                item.setSelected(true, animated: animated)
-                delegate?.tabNavigationBar?(self, didSelectTitleItemAt: index)
+                delegate?.tabNavigationBar?(self, willSelectTitleItemAt: index)
+                item.setSelected(true, animated: animated) { [unowned self] in
+                    self.delegate?.tabNavigationBar?(self, didSelectTitleItemAt: index)
+                }
             } else {
                 item.setSelected(false, animated: animated)
             }

                _titleColorAnimation.property = POPAnimatableProperty.attributedButtonTextColor(for: _ns_range, state: .normal)
                _titleColorAnimation.toValue = _selectionTitleColors[selected]
                _titleColorAnimation.removedOnCompletion = true
                self._button.pop_add(_titleColorAnimation, forKey: "ATTRIBUTEDCOLOR")
            } else {
                let _fontSizeAnimation = POPSpringAnimation()

        return _selectionTitleFonts[selected]!
    }
    
    public func setSelected(_ selected: Bool, animated: Bool, completion: (() -> Void)? = nil) {
        if animated {
            if let range = selectedRange {
                let _ns_range = NSMakeRange(range.lowerBound, range.upperBound - range.lowerBound)
