我對結果複製按鈕代碼(從displayResultLabel)如何複製兩個標籤的結果?
我怎樣才能知道它是從該兩個標籤一次(從resultLabel,displayResultLabel)
resultLabel複製 - 歷史
displayResultLabel - 結果
實施例:
resultLabel - 5 + 22
displayResultLabel - 27
5 + 22 = 27
我想這一點,但我得到這個:可選( 「5 + 22」)=可選( 「27」)
UIPasteboard.general.string = "\(String(describing: self.resultLabelText.text)) = \(String(describing: self.displayResultLabel.text))"
按鈕複製
...
let deleteActions = UIAlertAction(title: NSLocalizedString("Copy history",comment: ""), style: .default, handler: {
(alert: UIAlertAction!) -> Void in
UIPasteboard.general.string = self.resultLabelText.text
self.present(alert, animated: true, completion:nil)
})
...
非常感謝您 – DTF