Hi everyone, I am a new developer. I am writing some code in swift playgrounds and came across some odd errors. I have looked for solutions and have found nothing. If any more experienced developers could point me in the right direction, that would be great.
MyApp
likely has something called ContentView()
in it. This means that it wants to display the view called ContentView
. You seem to have deleted the lines that define ContentView
, so you need to put them back:
import SwiftUI
import AVFoundation
struct ContentView: View {
var body: some View {
Button("Greet me") {
let synthesizer = AVSpeechSynthesizer()
let utterance = AVSpeechUtterance(string: "Hello World!")
synthesizer.speak(utterance)
}
}
}