دنبال کننده ها

۱۳۹۶ آبان ۹, سه‌شنبه

uiviewcontroller - iOS - Navigationcontroller vs Viewcontroller with a navigation bar

[ad_1]



I am new to iOS and don't quite understand the benefits of Navigationcontrollers versus using a Viewcontroller with a navigation bar. I have tried researching this but the best answer I could find was from this link 3 years ago "https://www.reddit.com/r/swift/comments/2krv5p/why_would_you_use_a_navigation_controller_over_a/" which in summary mentions that it is due to the difficulty of achieving this when iOS first came around. Then it goes on to explain that it still has some current day usefulness which as you have to write your own segues with the navigation bar while the navigationcontroller does it automatically.



Fast forward to today and we are able to simply hold the control button and create a segue without typing code. Thus I am trying to figure out what are the pros of a navigationcontroller vs a viewcontroller with a navigaton bar. Because apart from this slight benefit, I feel that the navigationcontroller is not that intuitive and clean as it creates an "unused" controller.



I am also trying to figure out which way gives me more flexibility if I decide to increase the amount of pages as I realize that the height of the navigation bar and the navigatiocontroller's bar have 2 different height. (Which is weird to me and I do not understand why that is.)



Thank you.




[ad_2]

لینک منبع