At the end of my application I have a Navigation link that sends the user to a screen awhile an API call is made.
The problem is that it does not seem that the function to send the API data is actually running when I push the Navigation link... what am I doing wrong here?
HStack {
Spacer()
NavigationLink(destination: Success()
.navigationBarBackButtonHidden(true)){
Text("Finish")
.foregroundColor(Color.newPrimary)
.frame(minHeight: 40)
.frame(width: 311)
.background(Color.white)
.cornerRadius(10)
.padding(.top, 30)
}
.onTapGesture {
print("Sending to Storage")
SendData().sendData(apiData: data)
}
Spacer()
}