diff --git a/VDS/Components/Tabs/Tab.swift b/VDS/Components/Tabs/Tab.swift index b688e8d4..d21113ac 100644 --- a/VDS/Components/Tabs/Tab.swift +++ b/VDS/Components/Tabs/Tab.swift @@ -131,11 +131,8 @@ extension Tabs { accessibilityTraits = .button isAccessibilityElement = true - //activate the constraints - NSLayoutConstraint.activate([layoutGuide.topAnchor.constraint(equalTo: topAnchor), - layoutGuide.bottomAnchor.constraint(equalTo: bottomAnchor), - layoutGuide.leadingAnchor.constraint(equalTo: leadingAnchor), - layoutGuide.trailingAnchor.constraint(equalTo: trailingAnchor)]) + //pin layoutguide + layoutGuide.pinToOwningView() //pin trailing label.pinTrailing(layoutGuide.trailingAnchor) diff --git a/VDS/Components/Tabs/Tabs.swift b/VDS/Components/Tabs/Tabs.swift index 928daa8d..bc14d54f 100644 --- a/VDS/Components/Tabs/Tabs.swift +++ b/VDS/Components/Tabs/Tabs.swift @@ -187,13 +187,13 @@ open class Tabs: View { contentView.heightAnchor.constraint(equalTo: scrollView.heightAnchor).isActive = true - borderlineViewWidthConstraint = borderlineView.widthAnchor.constraint(equalToConstant: 0) - borderlineViewHeightConstraint = borderlineView.heightAnchor.constraint(equalToConstant: 0) + borderlineViewWidthConstraint = borderlineView.width(constant: 0) + borderlineViewHeightConstraint = borderlineView.height(constant: 0) - borderlineViewLeadingConstraint = borderlineView.leadingAnchor.constraint(equalTo: contentView.leadingAnchor) - borderlineViewTrailingConstraint = borderlineView.trailingAnchor.constraint(equalTo: contentView.trailingAnchor) - borderlineViewTopConstraint = borderlineView.topAnchor.constraint(equalTo: contentView.topAnchor) - borderlineViewBottomConstraint = borderlineView.bottomAnchor.constraint(equalTo: contentView.bottomAnchor) + borderlineViewLeadingConstraint = borderlineView.pinLeading(anchor: contentView.leadingAnchor) + borderlineViewTrailingConstraint = borderlineView.pinTrailing(anchor: contentView.trailingAnchor) + borderlineViewTopConstraint = borderlineView.pinTop(anchor: contentView.topAnchor) + borderlineViewBottomConstraint = borderlineView.pinBottom(anchor: contentView.bottomAnchor) } diff --git a/VDS/Components/Tabs/TabsContainer.swift b/VDS/Components/Tabs/TabsContainer.swift index 50eab591..5a48e6ea 100644 --- a/VDS/Components/Tabs/TabsContainer.swift +++ b/VDS/Components/Tabs/TabsContainer.swift @@ -132,12 +132,7 @@ open class TabsContainer: View { stackView.addArrangedSubview(tabMenu) stackView.addArrangedSubview(contentView) - NSLayoutConstraint.activate([ - tabMenuLayoutGuide.topAnchor.constraint(equalTo: topAnchor), - tabMenuLayoutGuide.bottomAnchor.constraint(equalTo: bottomAnchor), - tabMenuLayoutGuide.leadingAnchor.constraint(equalTo: leadingAnchor), - tabMenuLayoutGuide.trailingAnchor.constraint(equalTo: trailingAnchor) - ]) + tabMenuLayoutGuide.pinToOwningView() } /// Function used to make changes to the View based off a change events or from local properties.