Wednesday, October 28, 2026
HomeiOS Developmentios - SwiftUI and NavigationBar

ios – SwiftUI and NavigationBar

[ad_1]

I’ve a big iOS app with swift and XIBs for the view controllers.
Now I am progressively migrating from XIBs/View controllers to SwiftUI however I do not know how you can remedy a particular downside.

Some XIB/View controllers have a navigation bar, if these XIB/controllers push a SwiftUI view the SwiftUI view seems accurately with its content material and the navigation bar inherited from its mum or dad XIB view.
However a few of the SwiftUI views want to alter a few of the inherited navigation bar buttons and I do not know how you can entry from the SwiftUI code to the navigation bar content material.

I attempted to cover the inherited navigation bar utilizing

.navigationBarTitle("")
.navigationBarHidden(true)

(which is working) and making a SwiftUI navigationbar utilizing NavigationView element, however:

  1. I do not know if that is the proper strategy.

  2. Utilizing this NavigationView element the brand new navigation bar proven is far larger than the inherited navigation bar. Why is it exhibiting a a lot larger navbar? May I modify this heght and the way?

Thanks!

[ad_2]

RELATED ARTICLES

LEAVE A REPLY

Please enter your comment!
Please enter your name here

Most Popular

Recent Comments