如何呈现UICollectionViewController?

时间:2017-07-11 12:27:48

标签: ios swift uinavigationcontroller

我收到错误:

  

致命错误:在解包可选值时意外发现nil

didTapUserScreenButton()工作正常,didTapChatControllerButton()给出了错误。我认为它可能会收到错误,因为didTapChatControllerButton()转到UiCollectionViewController?而另一个工作正常,因为它会转到UITableViewController?

func didTapChatControllerButton() {
    let chat_log_controller = ChatLogController
    let navController = UINavigationController(rootViewController: chat_log_controller!)
    present(navController, animated: true, completion: nil)

}


func didTapUserScreenButton() {
    let user_screen_vc = usersScreenVC()
    let navController = UINavigationController(rootViewController: user_screen_vc)
    present(navController, animated: true, completion: nil)

1 个答案:

答案 0 :(得分:0)

您错过了(当前为空)初始化参数持有者括号。尝试使用tris:

int