Replace more with share button for timeline status swipe actions
This commit is contained in:
parent
2a8e970738
commit
8bbc572fa7
|
@ -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])
|
||||
}
|
||||
|
|
Loading…
Reference in New Issue