线程1:致命错误:意外地发现nil,同时隐式展开了一个可选值Label

问题描述

我只是在项目中包含了某些Firebase Pod,在此之前我的项目没有错误并且运行得很好,但是当我添加此代码时

override func viewDidAppear(_ animated: Bool) {
    super.viewDidAppear(animated)
    handleNotAuthenticated()
}
private func handleNotAuthenticated(){
    if Auth.auth().currentUser == nil{
    //            Show login
        let loginVC = LoginControllerViewController()
        loginVC.modalPresentationStyle = .fullScreen
        present(loginVC,animated: false)
            }
    //        else do nothing
}

我的loginVC错误,以下是我的loginVC代码:-

覆盖func viewDidLoad(){ super.viewDidLoad()

    Label.font = UIFont(name: "LobsterTwo-Bold",size: 35) //I got that fatal error here 
    LoginOutlet.titleLabel?.font = UIFont(name: "LobsterTwo-Bold",size: 25)
    DontHaveButtonO.titleLabel?.font = UIFont(name: "Georgia",size: 20)
    
    // Do any additional setup after loading the view.
}

我尝试显示一个空的(新VC),它工作正常,但是,每当我使用此LoginVC时,它都会给我上述错误,我尝试清理build文件夹并重新添加字体文件夹,请帮助我

解决方法

暂无找到可以解决该程序问题的有效方法,小编努力寻找整理中!

如果你已经找到好的解决方法,欢迎将解决方案带上本链接一起发送给小编。

小编邮箱:dio#foxmail.com (将#修改为@)