swift 無法像js那樣直接傳入參數. 需要借助tag傳參:
ListBtn.addTarget(self, action: "Detail:", forControlEvents: .TouchUpInside)
函數名中增加 ":" 字符
咱函數中通過傳入這個元素來實現傳值:
func Detail(sender:UIButton){ var DeailVc = DetailViewController() DeailVc.Id = sender.tag self.presentViewController(DeailVc, animated: true, completion: nil) }