? ? ? ? ? ?let titleLab:UILabel=UILabel()
? ? ? ? ? ? titleLab.frame=CGRect(x: 0, y:0, width: w, height: h)
? ? ? ? ? ? titleLab.text= "label"
? ? ? ? ? ? titleLab.textAlignment = NSTextAlignment.center
? ? ? ? ? ? self.view.addSubview(titleLab)
? ? ? ? ? ? titleLab.backgroundColor = UIColor.green
? ? ? ? ? ? lettap:UITapGestureRecognizer=UITapGestureRecognizer(target:self, action:#selector(tap(tapGesture:)))
? ? ? ? ? ? titleLab.addGestureRecognizer(tap)
? ? ? ? ? ? titleLab.isUserInteractionEnabled = true
//tap click
? @objc func tap(tapGesture:UITapGestureRecognizer)? {
? ? ? ? letclickLab = tapGesture.viewas!UILabel
? ? }