Swift 按钮在nib.file中没有反应
我在nib(xib)文件中有一个按钮,当我点击它时,它什么也不打印。我是xib.files的新手,我认为问题在于xib。 因此,按钮名称为ButtomnTapped,请在代码中查看它,因此当警报显示ViewController时,我单击按钮,它必须打印“Showin”,但不能打印任何内容。他会有什么问题?? 谢谢你的帮助 在my firstViewController中,显示TableViewAlertController:Swift 按钮在nib.file中没有反应,swift,button,alert,xib,Swift,Button,Alert,Xib,我在nib(xib)文件中有一个按钮,当我点击它时,它什么也不打印。我是xib.files的新手,我认为问题在于xib。 因此,按钮名称为ButtomnTapped,请在代码中查看它,因此当警报显示ViewController时,我单击按钮,它必须打印“Showin”,但不能打印任何内容。他会有什么问题?? 谢谢你的帮助 在my firstViewController中,显示TableViewAlertController: let AlertView = TableViewAlertC
let AlertView = TableViewAlertController()
let AlertTableView = SimpleAlert.Controller(view: AlertView.view, style: .Alert)
showAlert(AlertTableView)
TableViewAlertController与xib.xml文件
import UIKit
import SimpleAlert
class TableViewAlertController: UIViewController {
required init(coder aDecoder: NSCoder) {
super.init(coder: aDecoder)!
}
override init(nibName nibNameOrNil: String!, bundle nibBundleOrNil: NSBundle!) {
subView = UIView()
super.init(nibName: nibNameOrNil, bundle: nibBundleOrNil)
}
convenience init() {
self.init(nibName: "TableViewAlertController", bundle: nil)
}
@IBOutlet var subView: UIView!
@IBOutlet var BookTableView: UITableView!
override func viewDidLoad() {
super.viewDidLoad()
}
override func didReceiveMemoryWarning() {
super.didReceiveMemoryWarning()
// Dispose of any resources that can be recreated.
}
override func viewWillAppear(animated: Bool) {
super.viewWillAppear(animated)
}
@IBAction func ButtomnTapped(sender: AnyObject) {
print("Showin")
}
}