generated from Apodini/Template-Repository
-
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.
- Loading branch information
Paul Schmiedmayer
committed
Jun 23, 2021
1 parent
e8c6d23
commit 1ec2085
Showing
73 changed files
with
2,872 additions
and
210 deletions.
There are no files selected for viewing
This file was deleted.
Oops, something went wrong.
This file was deleted.
Oops, something went wrong.
This file was deleted.
Oops, something went wrong.
This file was deleted.
Oops, something went wrong.
11 changes: 11 additions & 0 deletions
11
Client/PresenterExample/Assets.xcassets/AccentColor.colorset/Contents.json
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,11 @@ | ||
{ | ||
"colors" : [ | ||
{ | ||
"idiom" : "universal" | ||
} | ||
], | ||
"info" : { | ||
"author" : "xcode", | ||
"version" : 1 | ||
} | ||
} |
98 changes: 98 additions & 0 deletions
98
Client/PresenterExample/Assets.xcassets/AppIcon.appiconset/Contents.json
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,98 @@ | ||
{ | ||
"images" : [ | ||
{ | ||
"idiom" : "iphone", | ||
"scale" : "2x", | ||
"size" : "20x20" | ||
}, | ||
{ | ||
"idiom" : "iphone", | ||
"scale" : "3x", | ||
"size" : "20x20" | ||
}, | ||
{ | ||
"idiom" : "iphone", | ||
"scale" : "2x", | ||
"size" : "29x29" | ||
}, | ||
{ | ||
"idiom" : "iphone", | ||
"scale" : "3x", | ||
"size" : "29x29" | ||
}, | ||
{ | ||
"idiom" : "iphone", | ||
"scale" : "2x", | ||
"size" : "40x40" | ||
}, | ||
{ | ||
"idiom" : "iphone", | ||
"scale" : "3x", | ||
"size" : "40x40" | ||
}, | ||
{ | ||
"idiom" : "iphone", | ||
"scale" : "2x", | ||
"size" : "60x60" | ||
}, | ||
{ | ||
"idiom" : "iphone", | ||
"scale" : "3x", | ||
"size" : "60x60" | ||
}, | ||
{ | ||
"idiom" : "ipad", | ||
"scale" : "1x", | ||
"size" : "20x20" | ||
}, | ||
{ | ||
"idiom" : "ipad", | ||
"scale" : "2x", | ||
"size" : "20x20" | ||
}, | ||
{ | ||
"idiom" : "ipad", | ||
"scale" : "1x", | ||
"size" : "29x29" | ||
}, | ||
{ | ||
"idiom" : "ipad", | ||
"scale" : "2x", | ||
"size" : "29x29" | ||
}, | ||
{ | ||
"idiom" : "ipad", | ||
"scale" : "1x", | ||
"size" : "40x40" | ||
}, | ||
{ | ||
"idiom" : "ipad", | ||
"scale" : "2x", | ||
"size" : "40x40" | ||
}, | ||
{ | ||
"idiom" : "ipad", | ||
"scale" : "1x", | ||
"size" : "76x76" | ||
}, | ||
{ | ||
"idiom" : "ipad", | ||
"scale" : "2x", | ||
"size" : "76x76" | ||
}, | ||
{ | ||
"idiom" : "ipad", | ||
"scale" : "2x", | ||
"size" : "83.5x83.5" | ||
}, | ||
{ | ||
"idiom" : "ios-marketing", | ||
"scale" : "1x", | ||
"size" : "1024x1024" | ||
} | ||
], | ||
"info" : { | ||
"author" : "xcode", | ||
"version" : 1 | ||
} | ||
} |
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,6 @@ | ||
{ | ||
"info" : { | ||
"author" : "xcode", | ||
"version" : 1 | ||
} | ||
} |
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,31 @@ | ||
import SwiftUI | ||
|
||
|
||
struct ConnectView: View { | ||
// MARK: Stored Properties | ||
|
||
var action: (URL) -> Void | ||
|
||
@State private var url = "" | ||
|
||
// MARK: Computed Properties | ||
|
||
var body: some View { | ||
NavigationView { | ||
VStack(spacing: 32) { | ||
TextField("URL", text: $url) | ||
Button("Connect", action: load) | ||
} | ||
.padding(32) | ||
.navigationTitle("Select Server") | ||
} | ||
} | ||
|
||
// MARK: Actions | ||
|
||
private func load() { | ||
if let url = URL(string: self.url) { | ||
action(url) | ||
} | ||
} | ||
} |
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,44 @@ | ||
import Presenter | ||
import SwiftUI | ||
|
||
|
||
struct ContentView: SwiftUI.View { | ||
// MARK: Stored Properties | ||
|
||
@ObservedObject var model: Model | ||
|
||
@SwiftUI.State private var url: URL? | ||
@SwiftUI.State private var error: String? | ||
@SwiftUI.State private var view: AnyView? | ||
|
||
// MARK: Computed Properties | ||
|
||
var body: some SwiftUI.View { | ||
if let view = view { | ||
view.environmentObject(model) | ||
} else if let error = error { | ||
ErrorView(error: error) { | ||
self.view = nil | ||
self.error = nil | ||
self.url = nil | ||
} | ||
} else if let url = url { | ||
LoadingView( | ||
url: url, | ||
view: $view, | ||
error: $error | ||
) | ||
} else { | ||
ConnectView { url in | ||
self.url = url | ||
} | ||
} | ||
} | ||
} | ||
|
||
|
||
struct ContentView_Previews: PreviewProvider { | ||
static var previews: some SwiftUI.View { | ||
ContentView(model: .init()) | ||
} | ||
} |
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,22 @@ | ||
import SwiftUI | ||
|
||
|
||
struct ErrorView: View { | ||
// MARK: Stored Properties | ||
|
||
var error: String | ||
var action: () -> Void | ||
|
||
// MARK: Computed Properties | ||
|
||
var body: some View { | ||
NavigationView { | ||
VStack(spacing: 32) { | ||
Text(error) | ||
Button("Try again", action: action) | ||
} | ||
.padding(32) | ||
.navigationTitle("Error") | ||
} | ||
} | ||
} |
Oops, something went wrong.