From 8bbc572fa7b60b07d398ef7c3cfa9b8d95c4b34a Mon Sep 17 00:00:00 2001 From: Shadowfacts Date: Sat, 27 Jun 2020 10:47:31 -0400 Subject: [PATCH] Replace more with share button for timeline status swipe actions --- .../Status/TimelineStatusTableViewCell.swift | 18 ++++++++++++++++-- 1 file changed, 16 insertions(+), 2 deletions(-) diff --git a/Tusker/Views/Status/TimelineStatusTableViewCell.swift b/Tusker/Views/Status/TimelineStatusTableViewCell.swift index 6e27058d..a961924b 100644 --- a/Tusker/Views/Status/TimelineStatusTableViewCell.swift +++ b/Tusker/Views/Status/TimelineStatusTableViewCell.swift @@ -257,11 +257,25 @@ extension TimelineStatusTableViewCell: TableViewSwipeActionProvider { } reply.image = UIImage(systemName: "arrowshape.turn.up.left.fill") reply.backgroundColor = tintColor - let more = UIContextualAction(style: .normal, title: "More") { (action, view, completion) in + + let moreTitle: String + let moreImage: UIImage + // on iOS 14+, more actions are in the context menu so display this as 'Share' + if #available(iOS 14.0, *) { + moreTitle = "Share" + // Bold to more closely match the other action symbols + let config = UIImage.SymbolConfiguration(weight: .bold) + moreImage = UIImage(systemName: "square.and.arrow.up")!.applyingSymbolConfiguration(config)! + } else { + moreTitle = "More" + moreImage = UIImage(systemName: "ellipsis.circle.fill")! + } + + let more = UIContextualAction(style: .normal, title: moreTitle) { (action, view, completion) in completion(true) self.delegate?.showMoreOptions(forStatus: self.statusID, sourceView: self) } - more.image = UIImage(systemName: "ellipsis.circle.fill") + more.image = moreImage more.backgroundColor = .lightGray return UISwipeActionsConfiguration(actions: [reply, more]) }