Skip to content
Snippets Groups Projects
Commit 52611a24 authored by Dariusz Rybicki's avatar Dariusz Rybicki
Browse files

Add NetworkHealthStatusView

parent 8ab5b3b5
No related branches found
No related tags found
1 merge request!11[Example App] Monitor network health
import SwiftUI
struct NetworkHealthStatusView: View {
var status: Bool?
var body: some View {
switch status {
case .some(true):
Label("Healthy", systemImage: "wifi")
.foregroundColor(.green)
case .some(false):
Label("Unhealthy", systemImage: "bolt.horizontal.fill")
.foregroundColor(.red)
case .none:
Label("Unknown", systemImage: "questionmark")
}
}
}
#if DEBUG
struct NetworkHealthStatusView_Previews: PreviewProvider {
static var previews: some View {
Group {
NetworkHealthStatusView(status: true)
NetworkHealthStatusView(status: false)
NetworkHealthStatusView(status: nil)
}
.previewLayout(.sizeThatFits)
}
}
#endif
0% Loading or .
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment