swift UIButton addTarget(给button添加点击事件)

 let btn =  UIButton.init(type: .contactAdd)
        btn.center = view.center;
        view.addSubview(btn);
        btn.addTarget(self, action: #selector(btnClick(btn:)), for: .touchUpInside);
        
        
    }
    
    
    @objc func btnClick(btn:UIButton){
        print(btn);
        
        
        
    }

已标记关键词 清除标记
相关推荐
©️2020 CSDN 皮肤主题: 大白 设计师:CSDN官方博客 返回首页