tap to show copy menu
This commit is contained in:
parent
5a0b97b22f
commit
67570256d0
3 changed files with 38 additions and 5 deletions
|
|
@ -13,6 +13,12 @@ class LabelTableViewCell: UITableViewCell {
|
|||
@IBOutlet weak var contentLabel: UILabel!
|
||||
@IBOutlet weak var titleLabel: UILabel!
|
||||
|
||||
override var canBecomeFirstResponder: Bool {
|
||||
get {
|
||||
return true
|
||||
}
|
||||
}
|
||||
|
||||
override func awakeFromNib() {
|
||||
super.awakeFromNib()
|
||||
}
|
||||
|
|
@ -20,5 +26,12 @@ class LabelTableViewCell: UITableViewCell {
|
|||
override func setSelected(_ selected: Bool, animated: Bool) {
|
||||
super.setSelected(selected, animated: animated)
|
||||
}
|
||||
|
||||
override func canPerformAction(_ action: Selector, withSender sender: Any?) -> Bool {
|
||||
return action == #selector(copy(_:))
|
||||
}
|
||||
override func copy(_ sender: Any?) {
|
||||
UIPasteboard.general.string = contentLabel.text
|
||||
}
|
||||
|
||||
}
|
||||
|
|
|
|||
Loading…
Add table
Add a link
Reference in a new issue