Guard
This commit is contained in:
parent
bf656cffea
commit
be045ac4a9
@ -28,40 +28,41 @@ public class StandardFooterView: ViewConstrainingView {
|
|||||||
|
|
||||||
public override func setupView() {
|
public override func setupView() {
|
||||||
super.setupView()
|
super.setupView()
|
||||||
if subviews.count == 0 {
|
guard subviews.count == 0 else {
|
||||||
translatesAutoresizingMaskIntoConstraints = false
|
return
|
||||||
backgroundColor = .clear
|
|
||||||
clipsToBounds = true
|
|
||||||
|
|
||||||
addSubview(twoButtonView)
|
|
||||||
addSubview(textButton)
|
|
||||||
|
|
||||||
topPin = twoButtonView.topAnchor.constraint(equalTo: topAnchor, constant: PaddingDefaultVerticalSpacing)
|
|
||||||
topPin?.isActive = true
|
|
||||||
|
|
||||||
spaceBetweenButtons = textButton.topAnchor.constraint(equalTo: twoButtonView.bottomAnchor, constant: PaddingTwo)
|
|
||||||
spaceBetweenButtons?.isActive = true
|
|
||||||
|
|
||||||
leftConstraintTwoButton = twoButtonView.leftAnchor.constraint(equalTo: leftAnchor)
|
|
||||||
leftConstraintTwoButton?.isActive = true
|
|
||||||
|
|
||||||
rightConstraintTwoButton = rightAnchor.constraint(equalTo: twoButtonView.rightAnchor)
|
|
||||||
rightConstraintTwoButton?.isActive = true
|
|
||||||
|
|
||||||
leftConstraintTextButton = textButton.leftAnchor.constraint(greaterThanOrEqualTo: leftAnchor)
|
|
||||||
leftConstraintTextButton?.isActive = true
|
|
||||||
|
|
||||||
rightConstraintTextButton = rightAnchor.constraint(greaterThanOrEqualTo: textButton.rightAnchor)
|
|
||||||
rightConstraintTextButton?.isActive = true
|
|
||||||
|
|
||||||
centerAlignTextButton = textButton.centerXAnchor.constraint(equalTo: centerXAnchor)
|
|
||||||
centerAlignTextButton?.isActive = true
|
|
||||||
|
|
||||||
bottomPin = bottomAnchor.constraint(equalTo: textButton.bottomAnchor, constant: PaddingDefaultVerticalSpacing)
|
|
||||||
bottomPin?.isActive = true
|
|
||||||
|
|
||||||
heightConstraint = heightAnchor.constraint(equalToConstant: 0)
|
|
||||||
}
|
}
|
||||||
|
translatesAutoresizingMaskIntoConstraints = false
|
||||||
|
backgroundColor = .clear
|
||||||
|
clipsToBounds = true
|
||||||
|
|
||||||
|
addSubview(twoButtonView)
|
||||||
|
addSubview(textButton)
|
||||||
|
|
||||||
|
topPin = twoButtonView.topAnchor.constraint(equalTo: topAnchor, constant: PaddingDefaultVerticalSpacing)
|
||||||
|
topPin?.isActive = true
|
||||||
|
|
||||||
|
spaceBetweenButtons = textButton.topAnchor.constraint(equalTo: twoButtonView.bottomAnchor, constant: PaddingTwo)
|
||||||
|
spaceBetweenButtons?.isActive = true
|
||||||
|
|
||||||
|
leftConstraintTwoButton = twoButtonView.leftAnchor.constraint(equalTo: leftAnchor)
|
||||||
|
leftConstraintTwoButton?.isActive = true
|
||||||
|
|
||||||
|
rightConstraintTwoButton = rightAnchor.constraint(equalTo: twoButtonView.rightAnchor)
|
||||||
|
rightConstraintTwoButton?.isActive = true
|
||||||
|
|
||||||
|
leftConstraintTextButton = textButton.leftAnchor.constraint(greaterThanOrEqualTo: leftAnchor)
|
||||||
|
leftConstraintTextButton?.isActive = true
|
||||||
|
|
||||||
|
rightConstraintTextButton = rightAnchor.constraint(greaterThanOrEqualTo: textButton.rightAnchor)
|
||||||
|
rightConstraintTextButton?.isActive = true
|
||||||
|
|
||||||
|
centerAlignTextButton = textButton.centerXAnchor.constraint(equalTo: centerXAnchor)
|
||||||
|
centerAlignTextButton?.isActive = true
|
||||||
|
|
||||||
|
bottomPin = bottomAnchor.constraint(equalTo: textButton.bottomAnchor, constant: PaddingDefaultVerticalSpacing)
|
||||||
|
bottomPin?.isActive = true
|
||||||
|
|
||||||
|
heightConstraint = heightAnchor.constraint(equalToConstant: 0)
|
||||||
}
|
}
|
||||||
|
|
||||||
public func setSpacing() {
|
public func setSpacing() {
|
||||||
|
|||||||
Loading…
Reference in New Issue
Block a user