import UIKit
class SecondVC: UIViewController,UITextFieldDelegate {
var tf1:UITextField?
override func viewDidLoad() {
super.viewDidLoad()
// Do any additional setup after loading the view.
self.view.backgroundColor = UIColor.white
let title = UILabel(frame: CGRect(x: 10, y: 130, width: Int(self.view.frame.width-20)/2, height: 50))
self.view.addSubview(title)
title.text = “请输入手机号”
title.font = UIFont.systemFont(ofSize: 30)
title.textColor = UIColor.black
let view1 = UIView(frame: CGRect(x: 10, y: Int(title.frame.height+130+20), width: Int(self.view.frame.width-20), height: 60))
view1.backgroundColor = UIColor.red
self.view.addSubview(view1)
let head = UIButton(frame: CGRect(x: 0, y: 0, width: 60, height: 60))
view1.addSubview(head)
head.setTitle("+86", for: UIControl.State.normal)
head.setTitleColor(UIColor.gray, for: .normal)
tf1 = UITextField(frame: CGRect(x: head.frame.width, y: 0, width: view1.frame.width-head.frame.width, height: 60))
view1.addSubview(tf1!)
tf1!.clearButtonMode = .always
tf1?.delegate = self
let btn = UIButton(frame: CGRect(x: 10, y: title.frame.height+130+20+view1.frame.height+10, width: self.view.frame.width-20, height: 60))
self.view.addSubview(btn)
btn.backgroundCol