diff --git a/Sources/FluentUI_iOS/Components/Pill Button Bar/PillButtonBar.swift b/Sources/FluentUI_iOS/Components/Pill Button Bar/PillButtonBar.swift index 2c8e01795..224ccccc1 100644 --- a/Sources/FluentUI_iOS/Components/Pill Button Bar/PillButtonBar.swift +++ b/Sources/FluentUI_iOS/Components/Pill Button Bar/PillButtonBar.swift @@ -81,20 +81,6 @@ open class PillButtonBar: UIScrollView { } } - public override var bounds: CGRect { - didSet { - if bounds.width > 0, lastKnownScrollFrameWidth > 0, bounds.width != lastKnownScrollFrameWidth { - // Frame changes can happen because of rotation, split view or adding the view for the first - // time into a superview. First time layout already has buttons in default sizes, recreate - // them so that the next time we layout subviews we'll recalculate their optimal sizes. - recreateButtons() - stackView.spacing = Constants.minButtonsSpacing - } - - lastKnownScrollFrameWidth = bounds.width - } - } - /// Initializes the PillButtonBar using the provided style. /// /// - Parameters: @@ -207,8 +193,6 @@ open class PillButtonBar: UIScrollView { private var buttons = [PillButton]() - private var lastKnownScrollFrameWidth: CGFloat = 0.0 - private var needsButtonSizeReconfiguration: Bool = false private var selectedButton: PillButton? { @@ -394,19 +378,6 @@ open class PillButtonBar: UIScrollView { return nil } - private func recreateButtons() { - let selectedItem = selectedButton?.pillBarItem - selectedButton = nil - - let currentItems = items - items = nil - items = currentItems - - if let selectedItem = selectedItem { - selectItem(selectedItem) - } - } - private func setupScrollView() { if effectiveUserInterfaceLayoutDirection == .rightToLeft { transform = CGAffineTransform(rotationAngle: CGFloat(Double.pi))