-
Notifications
You must be signed in to change notification settings - Fork 0
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
Fixed crash on error, improved errors.
- Loading branch information
Showing
6 changed files
with
90 additions
and
67 deletions.
There are no files selected for viewing
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,53 @@ | ||
// | ||
// ErrorView.swift | ||
// SeedTruck | ||
// | ||
// Created by Eduardo Almeida on 24/08/2020. | ||
// | ||
|
||
import SwiftUI | ||
|
||
struct ErrorView: View { | ||
|
||
enum ErrorType { | ||
|
||
case noConnection | ||
case notSupported | ||
} | ||
|
||
let type: ErrorType | ||
|
||
var body: some View { | ||
VStack { | ||
Spacer() | ||
|
||
Image(systemName: "questionmark.folder") | ||
.font(.largeTitle) | ||
|
||
Text("Error!") | ||
.font(.headline) | ||
.padding() | ||
|
||
switch type { | ||
case .noConnection: | ||
Text("Data could not be retrieved from the server.") | ||
.fontWeight(.light) | ||
case .notSupported: | ||
Text("The server does not support the requested functionality.") | ||
.fontWeight(.light) | ||
} | ||
|
||
Spacer() | ||
} | ||
} | ||
} | ||
|
||
struct ServerConnectionErrorView_Previews: PreviewProvider { | ||
|
||
static var previews: some View { | ||
Group { | ||
ErrorView(type: .noConnection) | ||
ErrorView(type: .notSupported) | ||
} | ||
} | ||
} |
This file was deleted.
Oops, something went wrong.
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters