I have 2 files that I want to work together or something.
The first is the main file: ContentView.swift. The second is the file where my other view is: KeysView.swift.
This is what KeysView contains:
In ContentView, I'm trying to call the view using KeysView(), but I keep getting a Cannot find 'KeysView' in scope error.
The first is the main file: ContentView.swift. The second is the file where my other view is: KeysView.swift.
This is what KeysView contains:
Code Block struct KeysView: View { var body: some View { HStack { Button(action: { }) { Text("1") .padding() .background(Color.black) .clipShape(/*@START_MENU_TOKEN@*/Circle()/*@END_MENU_TOKEN@*/) } Button(action: { }) { Text("2") .padding() .background(Color.black) .clipShape(/*@START_MENU_TOKEN@*/Circle()/*@END_MENU_TOKEN@*/) } Button(action: { }) { Text("3") .padding() .background(Color.black) .clipShape(/*@START_MENU_TOKEN@*/Circle()/*@END_MENU_TOKEN@*/) } } HStack { Button(action: { }) { Text("4") .padding() .background(Color.black) .clipShape(/*@START_MENU_TOKEN@*/Circle()/*@END_MENU_TOKEN@*/) } Button(action: { }) { Text("5") .padding() .background(Color.black) .clipShape(/*@START_MENU_TOKEN@*/Circle()/*@END_MENU_TOKEN@*/) } Button(action: { }) { Text("6") .padding() .background(Color.black) .clipShape(/*@START_MENU_TOKEN@*/Circle()/*@END_MENU_TOKEN@*/) } } HStack { Button(action: { }) { Text("7") .padding() .background(Color.black) .clipShape(/*@START_MENU_TOKEN@*/Circle()/*@END_MENU_TOKEN@*/) } Button(action: { }) { Text("8") .padding() .background(Color.black) .clipShape(/*@START_MENU_TOKEN@*/Circle()/*@END_MENU_TOKEN@*/) } Button(action: { }) { Text("9") .padding() .background(Color.black) .clipShape(/*@START_MENU_TOKEN@*/Circle()/*@END_MENU_TOKEN@*/) } } } }
In ContentView, I'm trying to call the view using KeysView(), but I keep getting a Cannot find 'KeysView' in scope error.