Closed cedared closed 7 years ago
even I add viewwillappear it still crash
import UIKit
import Eureka
class NormalLoginViewController: FormViewController {
var delegate: NormalLoginViewControllerDelegate?
}
extension NormalLoginViewController {
override func viewDidLoad() {
super.viewDidLoad()
setupView()
formCreater()
// Do any additional setup after loading the view.
}
override func didReceiveMemoryWarning() {
super.didReceiveMemoryWarning()
// Dispose of any resources that can be recreated.
}
override func viewWillAppear(_ animated: Bool) {
super.viewWillAppear(animated)
}
}
extension NormalLoginViewController {
fileprivate func setupView() {
tableView?.backgroundColor = UIColor.dancebookBackground
tableView?.isScrollEnabled = false
}
fileprivate func formCreater() {
form +++ Section()
<<< TextRow() {
row in
row.cell.textField.textAlignment = .left
row.cell.textField.placeholder = "用户名/手机号"
}
<<< PasswordRow() {
row in
row.cell.textField.textAlignment = .left
row.cell.textField.placeholder = "密码"
}
}
}
protocol NormalLoginViewControllerDelegate {
}
I had to comment out most of the inputAccessoryView method in Core.swift. I commented out the navigationAccessoryView lines in the method. Not a permanent solution by any means, but it temporarily solved the problem. I believe there is a problem with the navigationAccessoryView not getting initiated properly in some cases. Check where you are crashing. If it's in this method, could be the same thing.
Same Problem here. I override viewWillAppear and it still crashes
I resoloved this issue by adding below on viewDidLoad()
navigationAccessoryView = NavigationAccessoryView(frame: CGRect(x: 0, y: 0, width: view.frame.width, height: 40))
The reason why the crush is occuring is navigationAccessoryView
, which is IUO property, is not initialized maybe.
I couldn't run into the same issue. Anyway after some testing I think we can move the code that initialise NavigationAccessoryView from viewWillAppear to viewDidLoad.
I have the same problem with #763 and #718
but I really don't override viewwillappear