在 swift 中可以使用系統(tǒng)關(guān)鍵字來(lái)作為方法名稱(chēng),只需要給關(guān)鍵字加上單引號(hào)即可
private func setUI() -> Void{
let button = UIButton(type: .custom)
button.frame = self.view.bounds
button.setTitle("回去", for: .normal)
button.addTarget(self, action: #selector(`return`), for:.touchUpInside)
self.view.addSubview(button)
}
// 看這個(gè)方法的名字
@objc func `return`() -> Void{
print("低調(diào)")
}