feat: updated method to hide and show subtitle of DefaultTitleSubtitleView
This commit is contained in:
parent
7e41552521
commit
f2c390f71a
|
|
@ -67,17 +67,15 @@ public final class DefaultTitleSubtitleView: BaseInitializableView,
|
|||
titleLabel.text = viewModel.title
|
||||
subtitleLabel.text = viewModel.subtitle
|
||||
|
||||
if viewModel.isSubtitleHidden {
|
||||
remakeConstraintsForOneTitle()
|
||||
}
|
||||
hideSubtitle(viewModel.isSubtitleHidden)
|
||||
}
|
||||
|
||||
// MARK: - Public methods
|
||||
|
||||
public func remakeConstraintsForOneTitle() {
|
||||
subtitleLabel.isHidden = true
|
||||
spacingConstraint?.isActive = false
|
||||
titleLableBottomConstraint?.isActive = true
|
||||
public func hideSubtitle(_ isHidden: Bool) {
|
||||
subtitleLabel.isHidden = isHidden
|
||||
spacingConstraint?.isActive = !isHidden
|
||||
titleLableBottomConstraint?.isActive = isHidden
|
||||
}
|
||||
}
|
||||
|
||||
|
|
|
|||
Loading…
Reference in New Issue