How can I resolve this error ?
Cannot find 'SecondView' in scope in NavigationView :
NavigationView {
VStack(spacing: 30) {
Text("...")
Spacer()
NavigationLink(destination: SecondView()) // Here is error {
Text; (("..."))
.foregroundColor(....)
}
Button("...") {
self.selection = "..."
}
}
Selecting any option will automatically load the page
Post
Replies
Boosts
Views
Activity
How can I fix it in swift 5 ?
Binary operator '/' cannot be applied to two '() -> [Double]' operands
What can I do about this error ?
Closure containing a declaration cannot be used with result builder 'ViewBuilder'
struct ContentView: View { // <- error is here
.....
}
Hi, how can I solve this errors ? :
Cannot find type 'Video' in scope.
Cannot find '$selectedVideo' in scope.
Cannot find 'ErrorView' in scope.
import SwiftUI
import AVKit
struct ContentView: View {
@State private var selectedVideo: Video? // the error is here
var selectedVideo = video // the same error
var body:some View {
NavigationView {
.fullScreenCover(item: $selectedVideo) { // error
// On Dismiss Closure
} content: { item in
makeFullScreenVideoPlayer(for: item)
}
@ViewBuilder
func makeFullScreenVideoPlayer(for video: Video) -> some View {
// 1
if let url = video.videoURL {
// 2
let avPlayer = AVPlayer(url: url)
// 3
VideoPlayer(player: avPlayer)
// 4
.edgesIgnoringSafeArea(.all)
.onAppear {
// 5
avPlayer.play()
}
} else {
ErrorView() // error
}
}
```