Why am I getting this error?
struct ContentView: View {
var folders = ["Folder1", "Folder2"]
@State var searchString = ""
@State var newFolderName = ""
var body: some View { //This is where the error shows...
ZStack {
NavigationView {
List {
TextField("Search", text: $searchString)
Section(header:
Text("On My iPhone")
.font(.title3)
.fontWeight(.bold)
.foregroundColor(.black)) {
ForEach (folders, id: \.self) { folderName in
FolderCell(name: folderName)
}
.textCase(nil)
}
.listStyle(InsetGroupedListStyle())
.navigationTitle("Folders")
.toolbar {
ToolbarItemGroup(placement: .navigationBarTrailing) {
Button("Edit") {
print("Edit")
}
}
ToolbarItemGroup(placement: .bottomBar) {
Image(systemName: "folder.badge.plus")
Image(systemName: "square.and.pencil")
}
RoundedRectangle(cornerRadius: 7)
.fill(Color(.systemGray4))
.frame(width: 200, height: 299, alignment: .center)
VStack {
Text("New Folder")
Text("Enter a name for this folder")
TextField("Name", text: $newFolderName)
}
}
}
}
}
}
struct ContentView_Previews: PreviewProvider {
static var previews: some View {
ContentView()
}
}
struct FolderCell: View {
var name: String
var body: some View {
HStack {
Image(systemName: "Folder")
Text(name)
}
}
}
}
Selecting any option will automatically load the page
Post
Replies
Boosts
Views
Activity
I am creating an application that will count how many times the user has clicked on a button. I wrote the code, but it gives me an error: Unterminated string literal
I do not know what to do, I have already tried to fix it, but all attempts were in vain. Help me please.