[ios] remove spacing and separator from the Track recording Place page

Signed-off-by: Kiryl Kaveryn <kirylkaveryn@gmail.com>
This commit is contained in:
Kiryl Kaveryn
2025-06-16 12:48:58 +04:00
committed by Konstantin Pastbin
parent 18be61e789
commit a88798fbf2
3 changed files with 20 additions and 7 deletions

View File

@@ -176,8 +176,10 @@ final class PlacePageScrollView: UIScrollView {
private func setupLayout(_ layout: IPlacePageLayout) {
setLayout(layout)
fillHeader(with: layout.headerViewControllers)
fillBody(with: layout.bodyViewControllers)
let showSeparator = layout.sectionSpacing > 0
stackView.spacing = layout.sectionSpacing
fillHeader(with: layout.headerViewControllers, showSeparator: showSeparator)
fillBody(with: layout.bodyViewControllers, showSeparator: showSeparator)
beginDragging = false
if let actionBar = layout.actionBar {
@@ -188,23 +190,27 @@ final class PlacePageScrollView: UIScrollView {
}
}
private func fillHeader(with viewControllers: [UIViewController]) {
private func fillHeader(with viewControllers: [UIViewController], showSeparator: Bool = true) {
viewControllers.forEach { [self] viewController in
if !stackView.arrangedSubviews.contains(headerStackView) {
stackView.addArrangedSubview(headerStackView)
}
headerStackView.addArrangedSubview(viewController.view)
}
headerStackView.addSeparator(.bottom)
if showSeparator {
headerStackView.addSeparator(.bottom)
}
}
private func fillBody(with viewControllers: [UIViewController]) {
private func fillBody(with viewControllers: [UIViewController], showSeparator: Bool = true) {
viewControllers.forEach { [self] viewController in
addChild(viewController)
stackView.addArrangedSubview(viewController.view)
viewController.didMove(toParent: self)
viewController.view.addSeparator(.top)
viewController.view.addSeparator(.bottom)
if showSeparator {
viewController.view.addSeparator(.top)
viewController.view.addSeparator(.bottom)
}
}
}