Hello! I have problem with ContentView.swift. In Canvas preview I have an error: Failed to build ContentView.swift. Xcode doesn't show an error messages in my code. How to fix this problem? My code in Content View
import SwiftUI
struct ContentView: View {
@State private var login = ""
@State private var password = ""
var body: some View {
VStack {
TextField ("Логин", text : $login)
.textFieldStyle(RoundedBorderTextFieldStyle())
.padding()
SecureField("Пароль",text : $password)
.textFieldStyle(RoundedBorderTextFieldStyle())
.padding()
Button(action: loginButtonTapped) {
Text("Войти")
.foregroundColor(.white)
.padding()
.frame(maxWidth: .infinity)
.background(Color.blue)
.cornerRadius(5)
}
.padding()
}
.padding()
}
func loginButtonTapped() {
// Handle login logic here
}
}
struct ContentView_Previews: PreviewProvider {
static var previews: some View {
ContentView()
}
}
![]("https://developer.apple.com/forums/content/attachment/927e8aac-a3e0-4dae-8939-6a82cd77a4ff" "title=Снимок экрана 2023-04-28 в 20.55.06.png;width=3024;height=1964")