I'm using foreach to make some options in a horizontal scrollview then I want to link the next page view. The problem is putting Symbol SF in the code. How can I put this according to the code?
ScrollView(.horizontal, showsIndicators: false)
{
HStack()
{
ForEach(MockData.items) {item in
RoundedRectangle(cornerRadius: 10 )
.frame(width: 80, height: 80)
.foregroundStyle(item.color.gradient)
}
}
struct Item: Identifiable {
let id = UUID()
let color: Color
//var image: Image
}
struct MockData { static var items = [Item(color: .red), Item(color: .blue), Item(color: .orange), Item(color: .green), Item(color:.purple)] }