Does it show (for example, Push) from the view manager to the navigation controller ?! What for?

So, I am new to iOS programming, and I use Swift language. After running a few beginner applications. I had some problems calculating the difference between Show (e.g. Push) and deprecated Push segments .

What I want to do is show / click from ViewController A (built-in with navigation controller B ) to navigation controller C (containing View D controller ).

Since when I turn off “Use size classes”, Push segue does not work and will report an error “clicking on the navigation controller is not supported”. This error makes sense since you can only use regular view controllers.

However, when I turn on “Use size classes” (which turns the Viewcontroller into a square instead of a rectangle), I was able to show (like Push) a navigation controller that really confuses me.

So what is the main difference between Show (e.g. Push) and deprecated Push ? As for my knowledge, there is no significant functional difference, but the fact seems to prove that I'm wrong and makes me embarrassed.

+4
source share
1 answer

Update:

I recreated the behavior you are observing. Show (e.g. Push) segue really works with one viewController built into the navigationController, in the second viewController built into another navigation manager.

Note that when a click occurs, the second viewController moves normally, and a back button appears, which returns you to the first viewController. This suggests that the second viewController is actually pushed onto the stack of the first navigation controller. Therefore, instead of giving you an error message, it simply ignores your second navigation controller.

navigationController viewController navigationController. viewController navigationController, Push segue viewController navigationController, Storyboard , viewController .


:

A (, Push) segue - Adaptive Segue. .

  • viewController , Push.
  • viewController SplitViewController NavigationController, .
  • .

, , segue , , . , viewController , .

: .

+3

Source: https://habr.com/ru/post/1599633/


All Articles