i did "
// customslidebar.swift
// chatbot
//
// Created by AndrewLee on 2022/05/04.
//
import SwiftUI
enum Tab: String, CaseIterable {
case house
case message
case person
case gearshape
}
struct customslidebar: View {
@Binding var selectedTab: Tab
private var fillimage: String {
selectedTab.rawValue + ".fill"
}
var body: some View {
VStack {
HStack {
ForEach(Tab.allCases, id: .rawValue) { tab in
Spacer()
image(systemName: selectedTab == tab ? fillimage : tab.rawValue)
Spacer()
}
}
.frame(width: nil, height: 60)
.background(.thinMaterial)
.cornerRadius(10)
.padding()
}
}
}
struct customslidebar_Previews: PreviewProvider {
static var previews: some View {
customslidebar(selectedTab: .constant(.house))
}
}
this but it says Failed to produce diagnostic for expression; please submit a bug report (https://swift.org/contributing/#reporting-bugs) and include the project
1
0
959