Remove Navigation Controller behavior from one View

This is my structure of my project:
  • >TabBarController->NavController->A1->A2->A3->A4

From the TabBarController are similar to this structure several other NavController.
I want A4 to behave like there were no Nav Controller in this project. There should not be a back Button or TabBar.

Like the Project were structured like this:
  • >B1->B2

Is this possible?


Answered by Claude31 in 650453022
How will you get out of A4 ?

You can remove the segue that connects to A4.
Then in the button in A3 that previously led to A4, you should instantiate A4.
let newController = storyboard?.instantiateViewController(withIdentifier: "A4") as ? ClassForA4

Do you just want to hide the back button ?
Accepted Answer
How will you get out of A4 ?

You can remove the segue that connects to A4.
Then in the button in A3 that previously led to A4, you should instantiate A4.
let newController = storyboard?.instantiateViewController(withIdentifier: "A4") as ? ClassForA4

Do you just want to hide the back button ?
If you want to hide the Back button:
  • create a specific class for A4

  • in viewDidLoad, hide the button

Code Block
class ViewController4: UIViewController {
override func viewDidLoad() {
super.viewDidLoad()
// Do any additional setup after loading the view.
self.navigationItem.setHidesBackButton(true, animated: true)
}
}


I want a to do a popover window and that works if I have no Navgation Controller, because the new View appears over the old one.
B1->B2
If I set the background color of B2 to Clear Color and put a Label with a blue background color on it. The program does what I want. The tricky part now is that I want to include this simple behavior to my project, which needs a NavController.
Your explanations between different posts are really confusing.

Please clarify what you want exactly.
  • Will B1 -> B2 be included in the TabBar ?

  • Is B2 the popover window ?

  • How is it called from B1 ? A button ?

I want a to do a popover window
So, why don't you simply
  • create a UIView in B1

  • set it as hidden in IB

  • when to tap the button, just unhide the view

  • propose a way to hid back the view (either a button or simply when tapping on the view)

That would be much simpler than create a B2 VC

If that works, don't forget to close the thread by marking this as correct answer.
Otherwise, explain precisely what you want to achieve.

Sorry, I am not very good at explaining my problem. But your first answer works really good, after a few difficulties. Thank you, the solution was much simpler than I thought it could be

TabBarController->NavController->A1->A2->A3->A4

Better try something like this:
Code Block
->TabBarController->NavController->A1->A2->A3+
| ↓Trigger the transition from TabBarController to A4
+---------------------------------->A4


Code Block
import UIKit
class A3ViewController: UIViewController {
@IBAction func buttonTapped(_ sender: UIButton) {
let a4VC = self.storyboard?.instantiateViewController(identifier: "A4ViewController") as! A4ViewController
a4VC.modalPresentationStyle = .fullScreen
self.tabBarController?.present(a4VC, animated: true, completion: nil)
}
}

(You may need to modify your storyboard and/or this code depending on your current project settings.)
@Luise_2020
Thanks for the feedback.
Did you use the UIView display option ?

Don't forget to close the thread on this correct answer.

Good continuation.
Remove Navigation Controller behavior from one View
 
 
Q