2017-08-14 68 views
0

我有代碼複製標籤中的數字。從標籤複製按鈕

它是如何被調用的?

我怎麼能作出這樣的,當我點擊一個按鈕,看來照片

enter image description here

@IBAction func copybutton(_ sender: UIButton) { 
    UIPasteboard.general.string = displayResultLabel.text 
} 

回答

0

使用此代碼 -

UIPasteboard.general.string = sender.title(for: UIControlState.normal) 
+0

應該在哪裏它插入? – KVL

+0

用於點擊按鈕的IBAction方法。 –

+0

該應用崩潰 – KVL