Post

Replies

Boosts

Views

Activity

Invalid Redeclaration of Struct Name
There has been an error that sometimes repeats itself. How can I remove it? Struct Name: View { some data ... Struct ContentView: View { ... some data struct ContentView_Previews:        PreviewProvider {     static var previews: some View {         ContentView()     } } struct Name: View { // <- inwalid redeclaration of Struct Name    var body: some View {       Text("Name")    } } struct Name: View { // // <- inwalid redeclaration of Struct Name     var body: some View {        Text("Name")     } }
2
1
4.8k
Oct ’21
Closure containing a declaration cannot be used with result builder 'ViewBuilder' and Struct 'ViewBuilder' declared here (SwiftUI.ViewBuilder)
An error appears and I don't know how to solve it : Closure containing a declaration cannot be used with result builder 'ViewBuilder'. import SwiftUI Struct ContentView: View { var body: some View { // some code... struct ContentView_Previews: PreviewProvider { // <- error Closure containing a declaration cannot be used with result builder 'ViewBuilder'.     static var previews: some View {         ContentView()   } } Struct Name: View { // some code ... var body: some View { Text"some text" // some code ... Struct Name: View { var body: some View { Text"some text" Struct Name: View { var body: some View { Text"some text"
1
0
4.6k
Sep ’21
Cannot convert value of type 'Binding<String>.Type' to expected argument type 'Binding<String>' error in swift 5 Xcode 12.3
I have error: Cannot convert value of type 'Binding<String>.Type' to expected argument type 'Binding<String>' I am using Xcode version 12.3, swift 5 and iOS 14.3 Occurred when grouping static containers (TextField and Text) struct ContentView_Previews: PreviewProvider {     static var previews: some View {         ContentView(text: Binding<String>) // error is here     } } How can I solve this ?
1
0
10k
Jan ’21
Type of expression is ambiguous without more context
Hello, how can I get rid of this error ? Type of expression is ambiguous without more context  var body: some View {   NavigationView { // error is here     Form {         Group {         List {         VStack {                NavigationLink(<Text>(VStack {                         ScrollView(.vertical) {                             VStack(spacing: 13) {                                 ForEach(0..<1) {_ in TextField("Enter hour",text:$checknewHour                                                                 .keyboardType(.decimalPad)                                                                 .font(.system(size: 25)), Text("\(checknewHour) $ Hour")                                                                     .foregroundColor(.purple)                                                                     .font(.system(size: 25)),TextField("Enter minute",text:$checknewMinute                                                                                                         .keyboardType(.decimalPad)                                                                                                         .font(.system(size: 25)), Text("\(checknewMinute) $ Minute")                                                                                                             .foregroundColor(.purple)                                                                                                             .font(.system(size: 25)),
15
0
2.4k
Oct ’21