【发布时间】:2021-03-01 17:57:50
【问题描述】:
我正在尝试构建一个集成了聊天选项的应用程序。我的对话视图控制器(一个人的所有聊天都显示在具有多个单元格的 tableView 中)嵌入在导航控制器以及单个聊天视图控制器(您只与一个人聊天)中。
要从对话视图控制器转到单个聊天视图控制器,我正在实现此代码:
let storyboard = UIStoryboard(name: "Main", bundle: nil)
let _vc = storyboard.instantiateViewController(withIdentifier: "myNavigationController") as! UINavigationController
_vc.title = "John Smith"
_vc.modalPresentationStyle = .fullScreen
present(_vc, animated: true, completion: nil)
但是,_vc.title 没有显示在导航栏上。我该如何解决这个问题?
【问题讨论】: