我有一個NavigationController嵌入在我的TableViewController。當我運行應用程序時,一切正常,但導航欄不顯示。導航欄不顯示嵌入TableViewController - 斯威夫特
這是我的代碼的外觀:
override func tableView(_ tableView: UITableView, didSelectRowAt indexPath: IndexPath) {
let box = boxes[indexPath.row]
print(box.name)
if let storyboard = self.storyboard {
let viewController = storyboard.instantiateViewController(withIdentifier: "BoxDescriptionTVC") as! BoxDescriptionTableViewController
self.present(viewController, animated: false, completion: nil)
viewController.boxDetailsLabel.text = box.boxDescription
if let boxImageURL = box.boxImageURL {
viewController.boxImageView.loadImageUsingCacheWithUrlString(urlString: boxImageURL)
}
}
}
如何創建我NavigationController的實例來展示它,而不是TableViewController的?
你應該創建您的導航控制器的實例,並展示它,而不是BoxDescriptionTVC。 –
如何創建我的NavigationController實例來呈現它而不是TableViewController? – cosmos