         if shouldSendEventBeforeAnimations {
             sendActions(for: .valueChanged)
         }
-        if shouldUpdateAccessibilityTraitsBeforeAnimations {
-            updateAccessibilityTraits()
+        if shouldUpdateSegmentViewTraitsBeforeAnimations {
+            updateSegmentViewTraits()
         }
         performIndexChange(fromPreviousIndex: previousIndex, toNewIndex: index, animated: animated, completion: { [weak self] in
             guard let weakSelf = self else { return }

            if shouldSendEventAfterAnimations {
                weakSelf.sendActions(for: .valueChanged)
            }
            if shouldUpdateAccessibilityTraitsAfterAnimations {
                weakSelf.updateAccessibilityTraits()
            }
        })
    }

            }
        }
        
        // MARK: Initialization
        init() {
            super.init(frame: CGRect.zero)
            completeInit()
