flmcl
(francis)
1
Any help on this:
Result of 'ForEach<Data, ID, Content>' initializer is unused
func descriptionItem(myFrom: Int, myTo: Int) {
ForEach(myFrom ..< myTo) { item in
Button(action: {
self.myDetail = self.mySites[item]
self.saveData()
// self.showAlert = true
}) {
Text(self.mySites[item]).modifier(ButtonModifier())
}
}
}
AlexisQapa
(Alexis Schultz)
2
your function has no return type (Void). add -> some View to the end to fix it.
1 Like
flmcl
(francis)
3
Thanks I did this:
func descriptionItem(myFrom: Int, myTo: Int) -> some View{
and it works now.
Lantua
4
PS
You can put code inside tripple tick mark
```
Like this
```
So it'll be rendered
Like this
3 Likes