[ios] Extract PlacePagePhone class

It groups two phone-related properties, `phone` and `phoneUrl` (renamed
to `url`), that used to be in `PlacePageInfoData`. This will make it
easier to support an array of phones for one POI.

Signed-off-by: Eugene Nikolsky <omaps@egeek.me>
This commit is contained in:
Eugene Nikolsky
2025-04-02 18:18:33 +03:00
committed by Konstantin Pastbin
parent f1db7d7f98
commit 9be9f17df9
9 changed files with 60 additions and 12 deletions

View File

@@ -159,17 +159,17 @@ class PlacePageInfoViewController: UIViewController {
if let phone = placePageInfoData.phone {
var cellStyle: Style = .regular
if let phoneUrl = placePageInfoData.phoneUrl, UIApplication.shared.canOpenURL(phoneUrl) {
if let phoneUrl = phone.url, UIApplication.shared.canOpenURL(phoneUrl) {
cellStyle = .link
}
phoneView = createInfoItem(phone,
phoneView = createInfoItem(phone.phone,
icon: UIImage(named: "ic_placepage_phone_number"),
style: cellStyle,
tapHandler: { [weak self] in
self?.delegate?.didPressCall()
},
longPressHandler: { [weak self] in
self?.delegate?.didCopy(phone)
self?.delegate?.didCopy(phone.phone)
})
}