tTextFieldDelegate:NSObjectProtocol {
func editTextField(_ str: String) -> Void
}
@objc(SecondViewController)
class SecondViewController: UIViewController {
var editorDelegate:EditTextFieldDelegate?
var textField:UITextField?
var addButton:UIButton?
var pushButton:UIButton?
typealias editorBlock = (_ t:String) -> Void
var myEidtorBlock:editorBlock?
override func viewDidLoad() {
super.viewDidLoad()
self.view.backgroundColor = UIColor.white
textField = UITextField.init(frame: CGRect.init(x: 50, y: 60, width: 200, height: 50))
textField?.placeholder = "输入返回首页的内容"
self.view.addSubview(textField!)
addButton = UIButton.init(type: .custom)
addButton?.setTitleColor(UIColor.black, for: .normal)
addButton?.setTitle("pop", for: .normal)
addButton?.frame = CGRect.init(x: 50, y: 150, width: 200, height: 50)
addButton?.layer.borderColor = UIColor.black.cgColor
addButton?.layer.borderWidth = 1.0
addButton?.addTarget(self, action: #selector(popAction), for: .touchUpInside)
self.view.addSubview(addButton!)
pushButton = UIButton.init(type: .custom)
pushButton?.setTitleColor(UIColor.black |