New SwiftUI: Custom Navigation using Xcode 14

AnthonyDesignCode
4 min readNov 23, 2022
Photo by Jamie Street on Unsplash

Hello everyone, welcome to a new SwiftUI tutorial. I hope you are all doing well. Today I am going to show you how to design a Custom Navigation in SwiftUI 4 and Xcode 14.

Let’s get started with opening up Xcode 14. We are going to add 11 images to the asset file it does not matter what you add but please name them Post1 though to Post 11 cool! That being said let’s code! We are going to create a Swift file called Extensions.

import SwiftUI

// MARK: Customization Options for Navigation Bar
extension View{

func setNavbarColor(color: Color){

// MARK: Updating Nav Bar Color
DispatchQueue.main.asyncAfter(deadline: .now() + 0.01) {

NotificationCenter.default.post(name: NSNotification.Name("UPDATENAVBAR"), object: nil,userInfo: [

// Sending Color
"color": color
])
}
}

func resetNavBar(){
// MARK: Resetting Nav Bar
DispatchQueue.main.asyncAfter(deadline: .now() + 0.01) {
NotificationCenter.default.post(name: NSNotification.Name("UPDATENAVBAR"), object: nil)
}
}

func setNavbarTitleColor(color: Color){

DispatchQueue.main.asyncAfter(deadline: .now() + 0.01) {

NotificationCenter.default.post(name…

--

--

AnthonyDesignCode

Hey 👋 I’m Anthony! I hope you are well?! Thank you for looking at my blog. Here you will learn how to make apps in SwiftUI for iOS 16! Thanks for reading.