Add context menu previews to explore VC
This commit is contained in:
parent
478c7b7a23
commit
e76b719c6a
|
@ -238,6 +238,33 @@ class ExploreViewController: EnhancedTableViewController {
|
|||
return .delete
|
||||
}
|
||||
|
||||
override func tableView(_ tableView: UITableView, contextMenuConfigurationForRowAt indexPath: IndexPath, point: CGPoint) -> UIContextMenuConfiguration? {
|
||||
switch dataSource.itemIdentifier(for: indexPath) {
|
||||
case .bookmarks:
|
||||
return UIContextMenuConfiguration(identifier: nil, previewProvider: {
|
||||
return BookmarksTableViewController(mastodonController: self.mastodonController)
|
||||
}, actionProvider: nil)
|
||||
|
||||
case let .list(list):
|
||||
return UIContextMenuConfiguration(identifier: nil, previewProvider: {
|
||||
return ListTimelineViewController(for: list, mastodonController: self.mastodonController)
|
||||
}, actionProvider: nil)
|
||||
|
||||
case let .savedHashtag(hashtag):
|
||||
return UIContextMenuConfiguration(identifier: nil, previewProvider: {
|
||||
return HashtagTimelineViewController(for: hashtag, mastodonController: self.mastodonController)
|
||||
}, actionProvider: nil)
|
||||
|
||||
case let .savedInstance(url):
|
||||
return UIContextMenuConfiguration(identifier: nil, previewProvider: {
|
||||
return InstanceTimelineViewController(for: url, parentMastodonController: self.mastodonController)
|
||||
}, actionProvider: nil)
|
||||
|
||||
default:
|
||||
return nil
|
||||
}
|
||||
}
|
||||
|
||||
}
|
||||
|
||||
extension ExploreViewController {
|
||||
|
|
Loading…
Reference in New Issue