diff --git a/Artwork/Icons/More.svg b/Artwork/Icons/More.svg new file mode 100644 index 0000000000..2c9236d77c --- /dev/null +++ b/Artwork/Icons/More.svg @@ -0,0 +1,84 @@ + + + + + + + + + + image/svg+xml + + + + + + + + + + + + diff --git a/Tusker/Assets.xcassets/More.imageset/Contents.json b/Tusker/Assets.xcassets/More.imageset/Contents.json index 068cb005b6..7bdf444513 100644 --- a/Tusker/Assets.xcassets/More.imageset/Contents.json +++ b/Tusker/Assets.xcassets/More.imageset/Contents.json @@ -19,6 +19,7 @@ "author" : "xcode" }, "properties" : { + "template-rendering-intent" : "template", "preserves-vector-representation" : true } } \ No newline at end of file diff --git a/Tusker/Assets.xcassets/More.imageset/More.pdf b/Tusker/Assets.xcassets/More.imageset/More.pdf index f1d42118b8..e52037e651 100644 Binary files a/Tusker/Assets.xcassets/More.imageset/More.pdf and b/Tusker/Assets.xcassets/More.imageset/More.pdf differ diff --git a/Tusker/Extensions/UIViewController+Delegates.swift b/Tusker/Extensions/UIViewController+Delegates.swift index 1a9b478e36..fb1d4a0a1e 100644 --- a/Tusker/Extensions/UIViewController+Delegates.swift +++ b/Tusker/Extensions/UIViewController+Delegates.swift @@ -77,7 +77,20 @@ extension StatusTableViewCellDelegate where Self: UIViewController { present(vc, animated: true) } - func updatedStatus(for cell: StatusTableViewCell, status: Status) { + func showMoreOptions(status: Status) { + let alert = UIAlertController(title: nil, message: nil, preferredStyle: .actionSheet) + if let url = status.url { + alert.addAction(UIAlertAction(title: "Open in Safari...", style: .default, handler: { _ in + let vc = SFSafariViewController(url: url) + self.present(vc, animated: true) + })) + alert.addAction(UIAlertAction(title: "Share...", style: .default, handler: { _ in + let vc = UIActivityViewController(activityItems: [url], applicationActivities: nil) + self.present(vc, animated: true) + })) + } + alert.addAction(UIAlertAction(title: "Cancel", style: .cancel, handler: nil)) + present(alert, animated: true) } } diff --git a/Tusker/Views/Profile Header/ProfileHeaderTableViewCell.xib b/Tusker/Views/Profile Header/ProfileHeaderTableViewCell.xib index 5147d9c32d..84307e4897 100644 --- a/Tusker/Views/Profile Header/ProfileHeaderTableViewCell.xib +++ b/Tusker/Views/Profile Header/ProfileHeaderTableViewCell.xib @@ -60,13 +60,13 @@ + @@ -121,6 +131,7 @@ + @@ -148,6 +159,7 @@ + diff --git a/Tusker/Views/Status/StatusTableViewCell.swift b/Tusker/Views/Status/StatusTableViewCell.swift index c133e47bf5..72fdd75896 100644 --- a/Tusker/Views/Status/StatusTableViewCell.swift +++ b/Tusker/Views/Status/StatusTableViewCell.swift @@ -25,7 +25,7 @@ protocol StatusTableViewCellDelegate { func showLargeImage(_ image: UIImage, description: String?, animatingFrom originView: UIView) - func updatedStatus(for cell: StatusTableViewCell, status: Status) + func showMoreOptions(status: Status) } @@ -248,6 +248,10 @@ class StatusTableViewCell: UITableViewCell, PreferencesAdaptive { } } + @IBAction func morePressed(_ sender: Any) { + delegate?.showMoreOptions(status: status) + } + } extension StatusTableViewCell: HTMLContentLabelDelegate { diff --git a/Tusker/Views/Status/StatusTableViewCell.xib b/Tusker/Views/Status/StatusTableViewCell.xib index 704abfa261..c473c0d5dc 100644 --- a/Tusker/Views/Status/StatusTableViewCell.xib +++ b/Tusker/Views/Status/StatusTableViewCell.xib @@ -86,8 +86,8 @@ - - + + + @@ -127,6 +137,7 @@ + @@ -156,6 +167,7 @@ +