I’ve have outlined a customized button in my SwiftUI file as following.
struct CircleButtonWithIcon: View {
@State non-public var navigateToHomePage = false
var physique: some View {
Button(motion: {
}) {
Picture(systemName: "arrow.proper")
.font(.system(dimension: 24))
.foregroundColor(.white)
.padding(20)
.background(Coloration(#colorLiteral(pink: 1, inexperienced: 0.3607843137, blue: 0.003921568627, alpha: 1)))
.clipShape(Circle())
.overlay(
Circle()
.stroke(Coloration.white, lineWidth: 3)
)
}
}
}
I’m attempting to navigate to subsequent web page as following.
import SwiftUI
struct WelcomeView: View {
@State non-public var navigateToHomePage = false
var physique: some View {
NavigationView {
ZStack {
Picture("WelcomeBackground")
.resizable()
.aspectRatio(contentMode: .fill)
.body(minWidth: 0, maxWidth: .infinity)
.edgesIgnoringSafeArea(.all)
VStack(alignment: .heart) {
Spacer()
ZStack(alignment: .heart) {
VStack {
VStack {
HStack {
Textual content("No Fear,")
.font(.title)
.foregroundColor(.white)
.fontWeight(.daring)
Textual content("Deal with")
.font(.title)
.foregroundColor(.white)
.fontWeight(.common)
}
HStack {
Textual content("Your Starvation,")
.font(.title)
.foregroundColor(.white)
.fontWeight(.common)
Textual content("With")
.font(.title)
.foregroundColor(.white)
.fontWeight(.daring)
}
Textual content("Eattak!")
.font(.title)
.foregroundColor(.white)
.fontWeight(.daring)
Textual content("Eattak come that can assist you starvation downside with straightforward discover any restaurant")
.font(.physique)
.foregroundColor(.white).padding().multilineTextAlignment(.heart)
}
.padding()
NavigationLink(vacation spot: HomeView()) {
CircleButtonWithIcon()
}
}
.padding(.backside,100)
}
}.background(
Picture("welcome-black-shadow")
.resizable()
.aspectRatio(contentMode: .fill)
.body(minWidth: 0, maxWidth: .infinity)
)
.foregroundColor(.white)
.padding(.horizontal, 24)
}
}
}
}
I’ve added NavigationView
and inside that add NavigationLink
however on the button click on it is not navigating to the subsequent web page.
I’ve reviewed the entire questions however none of them helped
thanks