Skip to content

Error on Swift code on step3 #7

Open
@hrqmonteiro

Description

@hrqmonteiro
import SwiftUI
import Shared

struct ContentView: View {
    let phrases = Greeting().greet()

    var body: some View {
        List(phrases, id: \.self) {
            Text($0)
        }
    }
}

This code returns these errors:

Cannot convert value of type 'String' to expected argument type 'Binding<Data>'
Initializer 'init(_:)' requires that 'Binding<Data.Element>' conform to 'StringProtocol'

Screenshot 2024-05-02 at 11 22 05 AM

Metadata

Metadata

Assignees

No one assigned

    Labels

    No labels
    No labels

    Type

    No type

    Projects

    No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions