From 29964a4ceee1d615577436042ab3cebb51513433 Mon Sep 17 00:00:00 2001 From: Shadowfacts Date: Tue, 30 Oct 2018 22:24:49 -0400 Subject: [PATCH] Add peek/pop to profile headers --- .../Profile Header/ProfileHeaderTableViewCell.swift | 12 ++++++++++++ 1 file changed, 12 insertions(+) diff --git a/Tusker/Views/Profile Header/ProfileHeaderTableViewCell.swift b/Tusker/Views/Profile Header/ProfileHeaderTableViewCell.swift index 6ed628ee..47fc7f9e 100644 --- a/Tusker/Views/Profile Header/ProfileHeaderTableViewCell.swift +++ b/Tusker/Views/Profile Header/ProfileHeaderTableViewCell.swift @@ -112,3 +112,15 @@ class ProfileHeaderTableViewCell: UITableViewCell, PreferencesAdaptive { } } + +extension ProfileHeaderTableViewCell: PreviewViewControllerProvider { + func getPreviewViewController(forLocation location: CGPoint, sourceViewController: UIViewController) -> UIViewController? { + let noteLabelPoint = noteLabel.convert(location, from: self) + if noteLabel.bounds.contains(noteLabelPoint), + let vc = noteLabel.getViewController(forLinkAt: noteLabelPoint) { + return vc + } + // TODO: should this also have peek/pop for avatar/header images? + return nil + } +}