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()
}
}
