Вы можете попытаться использовать переход
// This is used to perform the segue with the approporiate identifier
self.performSegue(withIdentifier: "Your unique identifer of the seugue", sender: self)
// Prepare for segue is used if you want to modify some properities in the desintation viewcontroller
override func prepare(for segue: UIStoryboardSegue, sender: Any?) {
if segue.identifier == "Your identifier of the segue" {
// This is used to fetch the destination and cast it to pass over the values
if let dc = segue.destination as? YourClassOfTheDestination {
// Here can you type into dc and pass over the values
//Example
dc.curentFruit = "Pear"
}
}
}
Вот изображение о том, как указать пользовательский идентификатор перехода в раскадровке. Вот изображение
Если вы не хотите, чтобы панель навигации отображалась на определенных экранах, вы можете просто использовать:
override func viewWillAppear(_ animated: Bool) {
super.viewWillAppear(animated)
self.navigationController?.navigationBar.isHidden = true
}
override func viewWillDisappear(_ animated: Bool) {
super.viewWillAppear(animated)
self.navigationController?.navigationBar.isHidden = false
}
Не забудьте сделать его видимым снова, когда представление исчезает.
Отличный вопрос, надеюсь, ответ поможет!