我的功能有一個很髒的工作代碼。但是這看起來很錯,我想清理它。這裏的片段: var id = 'foo1'; //$(this).closest('.myclass').attr('id');
var class = 'morefoo'; //$(this).attr("class").split(" ").pop()
$('#' + id + ' .' + class).show();
今天我的編碼遇到了一些麻煩。試圖製作一個「自動」武器,但無法讓選擇器正常工作。 下面是代碼 override func touchesBegan(_ touches: Set<UITouch>, with event: UIEvent?) {
for touch in (touches){
let location = touch.location(in: self)fun
我試圖通過UIBarButtonItem作爲參數, 但我得到以下錯誤: Argument of '#selector' does not refer to an '@objc' method, property, or initializer @objc func barClicked(sender: AnyObject) {
}
override func viewDidLoad() {