I want to be able to run codes after taping span text.
I have done so far
HStack() {
Text("I have read and agree with app’s ")
+ Text("Disclaimer")
.foregroundColor(Color.appPrimary)
// .onTapGesture {
// print("Disclaimer")
// }
+ Text(", ")
+ Text("Terms of use")
.foregroundColor(Color.appPrimary)
// .onTapGesture {
// print("Terms of use")
// }
+ Text(" & ")
+ Text("Privacy policy")
.foregroundColor(Color.appPrimary)
// .onTapGesture {
// print("Privacy policy")
// }
+ Text(".")
}
.font(.system(size: 14))
As you can see I have commented onTapGesture because it gives error, Because the onTapGesture modifies Text into a View. And so I can’t join them and have click ability at the same time.