I want to check network reachability using Alamofire. This is the code:
var body: some Scene {
WindowGroup {
NetworkReachabilityManager()!.startListening { status in
switch status {
case .notReachable, .unknown:
Text("No internet")
.bold()
.padding(.horizontal, 2)
.frame(maxWidth: .infinity)
.background(Color(hex: 0xce01e37))
.foregroundColor(Color.white)
default : ()
}
}
...
But this error keeps showing:
Static method 'buildBlock' requires that 'Bool' conform to 'View'
Any solutions ?