[iOS] Add Existence and Opening Hour confirmation to Place Page

Signed-off-by: eisa01 <your.email@example.com>
This commit is contained in:
Eivind Samseth
2025-08-08 19:19:03 +02:00
committed by Yannik Bloscheck
parent 795fe0ee09
commit d1f9806901
11 changed files with 114 additions and 9 deletions

View File

@@ -3,7 +3,7 @@ protocol PlacePageHeaderViewProtocol: AnyObject {
var isExpandViewHidden: Bool { get set }
var isShadowViewHidden: Bool { get set }
func setTitle(_ title: String?, secondaryTitle: String?)
func setTitle(_ title: String?, secondaryTitle: String?, existenceConfirmation: String?)
func showShareTrackMenu()
}
@@ -77,7 +77,7 @@ extension PlacePageHeaderViewController: PlacePageHeaderViewProtocol {
}
}
func setTitle(_ title: String?, secondaryTitle: String?) {
func setTitle(_ title: String?, secondaryTitle: String?, existenceConfirmation: String? = nil) {
titleText = title
secondaryText = secondaryTitle
// XCode 13 is not smart enough to detect that title is used below, and requires explicit unwrapped variable.
@@ -93,6 +93,18 @@ extension PlacePageHeaderViewController: PlacePageHeaderViewProtocol {
let attributedText = NSMutableAttributedString(string: unwrappedTitle, attributes: titleAttributes)
// Add existence confirmation if available
if let existenceText = existenceConfirmation {
let existenceParagraphStyle = NSMutableParagraphStyle()
existenceParagraphStyle.paragraphSpacingBefore = 1
let existenceAttributes: [NSAttributedString.Key: Any] = [
.font: UIFont.systemFont(ofSize: 11),
.foregroundColor: UIColor.blackSecondaryText(),
.paragraphStyle: existenceParagraphStyle
]
attributedText.append(NSAttributedString(string: "\n" + existenceText, attributes: existenceAttributes))
}
guard let unwrappedSecondaryTitle = secondaryTitle else {
titleLabel?.attributedText = attributedText
return