diff --git a/iphone/Maps/UI/PlacePage/Components/PlacePageHeader/PlacePageHeaderViewController.swift b/iphone/Maps/UI/PlacePage/Components/PlacePageHeader/PlacePageHeaderViewController.swift index ef3524cea..25d8bd496 100644 --- a/iphone/Maps/UI/PlacePage/Components/PlacePageHeader/PlacePageHeaderViewController.swift +++ b/iphone/Maps/UI/PlacePage/Components/PlacePageHeader/PlacePageHeaderViewController.swift @@ -38,6 +38,9 @@ class PlacePageHeaderViewController: UIViewController { if presenter?.objectType == .track { configureTrackSharingMenu() } + + let interaction = UIContextMenuInteraction(delegate: self) + titleLabel?.addInteraction(interaction) } @objc func onExpandPressed(sender: UITapGestureRecognizer) { @@ -141,3 +144,14 @@ extension PlacePageHeaderViewController: PlacePageHeaderViewProtocol { shareButton.showsMenuAsPrimaryAction = true } } + +extension PlacePageHeaderViewController: UIContextMenuInteractionDelegate { + func contextMenuInteraction(_ interaction: UIContextMenuInteraction, configurationForMenuAtLocation location: CGPoint) -> UIContextMenuConfiguration? { + return UIContextMenuConfiguration(identifier: nil, previewProvider: nil, actionProvider: { suggestedActions in + let copyAction = UIAction(title: L("copy_to_clipboard"), image: UIImage(systemName: "document.on.clipboard")) { action in + UIPasteboard.general.string = self.titleLabel?.text + } + return UIMenu(title: "", children: [copyAction]) + }) + } +} diff --git a/iphone/Maps/UI/PlacePage/PlacePage.storyboard b/iphone/Maps/UI/PlacePage/PlacePage.storyboard index 04efc099c..2646bce51 100644 --- a/iphone/Maps/UI/PlacePage/PlacePage.storyboard +++ b/iphone/Maps/UI/PlacePage/PlacePage.storyboard @@ -1,9 +1,9 @@ - + - + @@ -1347,7 +1347,7 @@ -