Skip to content

Commit a0b0e34

Browse files
committed
Added Cancel Option for Match View
1 parent 8537e34 commit a0b0e34

12 files changed

Lines changed: 227 additions & 39 deletions

File tree

Examples/GKMatchMaker/GKMatchMaker.xcodeproj/project.pbxproj

Lines changed: 6 additions & 6 deletions
Original file line numberDiff line numberDiff line change
@@ -22,15 +22,15 @@
2222
151F91EE25E42EC60015DD88 /* PrimaryButtonModifier.swift in Sources */ = {isa = PBXBuildFile; fileRef = 151F91EC25E42EC60015DD88 /* PrimaryButtonModifier.swift */; };
2323
151F91F925E4EC070015DD88 /* AuthenticationViewModel.swift in Sources */ = {isa = PBXBuildFile; fileRef = 151F91F825E4EC070015DD88 /* AuthenticationViewModel.swift */; };
2424
151F91FA25E4EC070015DD88 /* AuthenticationViewModel.swift in Sources */ = {isa = PBXBuildFile; fileRef = 151F91F825E4EC070015DD88 /* AuthenticationViewModel.swift */; };
25+
152736842607D0740068853D /* MatchMakingView.swift in Sources */ = {isa = PBXBuildFile; fileRef = 152736812607D0730068853D /* MatchMakingView.swift */; };
26+
152736882607D07C0068853D /* MatchMakingView.swift in Sources */ = {isa = PBXBuildFile; fileRef = 152736812607D0730068853D /* MatchMakingView.swift */; };
2527
15A6F7D725E39B7D00FE5387 /* GameKitUI in Frameworks */ = {isa = PBXBuildFile; productRef = 15A6F7D625E39B7D00FE5387 /* GameKitUI */; };
2628
15A6F7D925E39B8300FE5387 /* GameKitUI in Frameworks */ = {isa = PBXBuildFile; productRef = 15A6F7D825E39B8300FE5387 /* GameKitUI */; };
2729
15A6F7DB25E39B8F00FE5387 /* GameKit.framework in Frameworks */ = {isa = PBXBuildFile; fileRef = 15A6F7DA25E39B8F00FE5387 /* GameKit.framework */; };
2830
15A6F7E225E39BC100FE5387 /* ContentView.swift in Sources */ = {isa = PBXBuildFile; fileRef = 15A6F7DF25E39BC100FE5387 /* ContentView.swift */; };
2931
15A6F7E325E39BC100FE5387 /* ContentView.swift in Sources */ = {isa = PBXBuildFile; fileRef = 15A6F7DF25E39BC100FE5387 /* ContentView.swift */; };
3032
15A6F7F125E39E0500FE5387 /* MatchMakingViewModel.swift in Sources */ = {isa = PBXBuildFile; fileRef = 15A6F7F025E39E0500FE5387 /* MatchMakingViewModel.swift */; };
3133
15A6F7F225E39E0500FE5387 /* MatchMakingViewModel.swift in Sources */ = {isa = PBXBuildFile; fileRef = 15A6F7F025E39E0500FE5387 /* MatchMakingViewModel.swift */; };
32-
15A6F7F625E39E5300FE5387 /* MatchMakingView.swift in Sources */ = {isa = PBXBuildFile; fileRef = 15A6F7F525E39E5300FE5387 /* MatchMakingView.swift */; };
33-
15A6F7F725E39E5300FE5387 /* MatchMakingView.swift in Sources */ = {isa = PBXBuildFile; fileRef = 15A6F7F525E39E5300FE5387 /* MatchMakingView.swift */; };
3434
15F85DE4260272CF0009A734 /* GKMatchMakerAppModel.swift in Sources */ = {isa = PBXBuildFile; fileRef = 15F85DE3260272CF0009A734 /* GKMatchMakerAppModel.swift */; };
3535
15F85DE7260272D20009A734 /* GKMatchMakerAppModel.swift in Sources */ = {isa = PBXBuildFile; fileRef = 15F85DE3260272CF0009A734 /* GKMatchMakerAppModel.swift */; };
3636
/* End PBXBuildFile section */
@@ -50,10 +50,10 @@
5050
151D895E2602660B00979718 /* MatchView.swift */ = {isa = PBXFileReference; lastKnownFileType = sourcecode.swift; path = MatchView.swift; sourceTree = "<group>"; };
5151
151F91EC25E42EC60015DD88 /* PrimaryButtonModifier.swift */ = {isa = PBXFileReference; lastKnownFileType = sourcecode.swift; path = PrimaryButtonModifier.swift; sourceTree = "<group>"; };
5252
151F91F825E4EC070015DD88 /* AuthenticationViewModel.swift */ = {isa = PBXFileReference; lastKnownFileType = sourcecode.swift; path = AuthenticationViewModel.swift; sourceTree = "<group>"; };
53+
152736812607D0730068853D /* MatchMakingView.swift */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.swift; path = MatchMakingView.swift; sourceTree = "<group>"; };
5354
15A6F7DA25E39B8F00FE5387 /* GameKit.framework */ = {isa = PBXFileReference; lastKnownFileType = wrapper.framework; name = GameKit.framework; path = System/Library/Frameworks/GameKit.framework; sourceTree = SDKROOT; };
5455
15A6F7DF25E39BC100FE5387 /* ContentView.swift */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.swift; path = ContentView.swift; sourceTree = "<group>"; };
5556
15A6F7F025E39E0500FE5387 /* MatchMakingViewModel.swift */ = {isa = PBXFileReference; lastKnownFileType = sourcecode.swift; path = MatchMakingViewModel.swift; sourceTree = "<group>"; };
56-
15A6F7F525E39E5300FE5387 /* MatchMakingView.swift */ = {isa = PBXFileReference; lastKnownFileType = sourcecode.swift; path = MatchMakingView.swift; sourceTree = "<group>"; };
5757
15F85DE3260272CF0009A734 /* GKMatchMakerAppModel.swift */ = {isa = PBXFileReference; lastKnownFileType = sourcecode.swift; path = GKMatchMakerAppModel.swift; sourceTree = "<group>"; };
5858
/* End PBXFileReference section */
5959

@@ -186,7 +186,7 @@
186186
15A6F7FC25E39F7D00FE5387 /* MultiPlayer */ = {
187187
isa = PBXGroup;
188188
children = (
189-
15A6F7F525E39E5300FE5387 /* MatchMakingView.swift */,
189+
152736812607D0730068853D /* MatchMakingView.swift */,
190190
151D895E2602660B00979718 /* MatchView.swift */,
191191
);
192192
path = MultiPlayer;
@@ -307,10 +307,10 @@
307307
files = (
308308
15F85DE4260272CF0009A734 /* GKMatchMakerAppModel.swift in Sources */,
309309
1507A0C625E419E5006DDBFC /* AuthenticationView.swift in Sources */,
310-
15A6F7F625E39E5300FE5387 /* MatchMakingView.swift in Sources */,
311310
151F91F925E4EC070015DD88 /* AuthenticationViewModel.swift in Sources */,
312311
151D895F2602660B00979718 /* MatchView.swift in Sources */,
313312
15A6F7E225E39BC100FE5387 /* ContentView.swift in Sources */,
313+
152736842607D0740068853D /* MatchMakingView.swift in Sources */,
314314
151F91ED25E42EC60015DD88 /* PrimaryButtonModifier.swift in Sources */,
315315
1507A0BD25E410CA006DDBFC /* GKMatchMakerApp.swift in Sources */,
316316
15A6F7F125E39E0500FE5387 /* MatchMakingViewModel.swift in Sources */,
@@ -323,10 +323,10 @@
323323
files = (
324324
15F85DE7260272D20009A734 /* GKMatchMakerAppModel.swift in Sources */,
325325
1507A0C725E419E5006DDBFC /* AuthenticationView.swift in Sources */,
326-
15A6F7F725E39E5300FE5387 /* MatchMakingView.swift in Sources */,
327326
151F91FA25E4EC070015DD88 /* AuthenticationViewModel.swift in Sources */,
328327
151D89602602660B00979718 /* MatchView.swift in Sources */,
329328
15A6F7E325E39BC100FE5387 /* ContentView.swift in Sources */,
329+
152736882607D07C0068853D /* MatchMakingView.swift in Sources */,
330330
151F91EE25E42EC60015DD88 /* PrimaryButtonModifier.swift in Sources */,
331331
1507A0BE25E410CA006DDBFC /* GKMatchMakerApp.swift in Sources */,
332332
15A6F7F225E39E0500FE5387 /* MatchMakingViewModel.swift in Sources */,

Examples/GKMatchMaker/Shared/GKMatchMakerApp.swift

Lines changed: 21 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -1,6 +1,25 @@
11
///
2-
/// GKMatchMakerApp.swift
3-
/// GKMatchMaker
2+
/// MIT License
3+
///
4+
/// Copyright (c) 2020 Sascha Müllner
5+
///
6+
/// Permission is hereby granted, free of charge, to any person obtaining a copy
7+
/// of this software and associated documentation files (the "Software"), to deal
8+
/// in the Software without restriction, including without limitation the rights
9+
/// to use, copy, modify, merge, publish, distribute, sublicense, and/or sell
10+
/// copies of the Software, and to permit persons to whom the Software is
11+
/// furnished to do so, subject to the following conditions:
12+
///
13+
/// The above copyright notice and this permission notice shall be included in all
14+
/// copies or substantial portions of the Software.
15+
///
16+
/// THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR
17+
/// IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY,
18+
/// FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE
19+
/// AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER
20+
/// LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM,
21+
/// OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE
22+
/// SOFTWARE.
423
///
524
/// Created by Sascha Müllner on 24.11.20.
625

Examples/GKMatchMaker/Shared/Modifiers/PrimaryButtonModifier.swift

Lines changed: 21 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -1,6 +1,25 @@
11
///
2-
/// PrimaryButtonModifier.swift
3-
/// GKMatchMaker
2+
/// MIT License
3+
///
4+
/// Copyright (c) 2020 Sascha Müllner
5+
///
6+
/// Permission is hereby granted, free of charge, to any person obtaining a copy
7+
/// of this software and associated documentation files (the "Software"), to deal
8+
/// in the Software without restriction, including without limitation the rights
9+
/// to use, copy, modify, merge, publish, distribute, sublicense, and/or sell
10+
/// copies of the Software, and to permit persons to whom the Software is
11+
/// furnished to do so, subject to the following conditions:
12+
///
13+
/// The above copyright notice and this permission notice shall be included in all
14+
/// copies or substantial portions of the Software.
15+
///
16+
/// THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR
17+
/// IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY,
18+
/// FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE
19+
/// AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER
20+
/// LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM,
21+
/// OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE
22+
/// SOFTWARE.
423
///
524
/// Created by Sascha Müllner on 22.02.21.
625
///

Examples/GKMatchMaker/Shared/ViewModels/Authentication/AuthenticationViewModel.swift

Lines changed: 21 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -1,6 +1,25 @@
11
///
2-
/// AuthenticationViewModel.swift
3-
/// GKMatchMaker
2+
/// MIT License
3+
///
4+
/// Copyright (c) 2020 Sascha Müllner
5+
///
6+
/// Permission is hereby granted, free of charge, to any person obtaining a copy
7+
/// of this software and associated documentation files (the "Software"), to deal
8+
/// in the Software without restriction, including without limitation the rights
9+
/// to use, copy, modify, merge, publish, distribute, sublicense, and/or sell
10+
/// copies of the Software, and to permit persons to whom the Software is
11+
/// furnished to do so, subject to the following conditions:
12+
///
13+
/// The above copyright notice and this permission notice shall be included in all
14+
/// copies or substantial portions of the Software.
15+
///
16+
/// THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR
17+
/// IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY,
18+
/// FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE
19+
/// AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER
20+
/// LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM,
21+
/// OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE
22+
/// SOFTWARE.
423
///
524
/// Created by smuellner on 23.02.21.
625

Examples/GKMatchMaker/Shared/ViewModels/GKMatchMakerAppModel.swift

Lines changed: 21 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -1,6 +1,25 @@
11
///
2-
/// GKMatchMakerAppModel.swift
3-
/// GKMatchMaker
2+
/// MIT License
3+
///
4+
/// Copyright (c) 2020 Sascha Müllner
5+
///
6+
/// Permission is hereby granted, free of charge, to any person obtaining a copy
7+
/// of this software and associated documentation files (the "Software"), to deal
8+
/// in the Software without restriction, including without limitation the rights
9+
/// to use, copy, modify, merge, publish, distribute, sublicense, and/or sell
10+
/// copies of the Software, and to permit persons to whom the Software is
11+
/// furnished to do so, subject to the following conditions:
12+
///
13+
/// The above copyright notice and this permission notice shall be included in all
14+
/// copies or substantial portions of the Software.
15+
///
16+
/// THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR
17+
/// IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY,
18+
/// FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE
19+
/// AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER
20+
/// LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM,
21+
/// OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE
22+
/// SOFTWARE.
423
///
524
/// Created by Sascha Müllner on 24.11.20.
625

Examples/GKMatchMaker/Shared/ViewModels/MultiPlayer/MatchMakingViewModel.swift

Lines changed: 21 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -1,6 +1,25 @@
11
///
2-
/// GKMatchMakerViewModel.swift
3-
/// GKMatchMaker
2+
/// MIT License
3+
///
4+
/// Copyright (c) 2020 Sascha Müllner
5+
///
6+
/// Permission is hereby granted, free of charge, to any person obtaining a copy
7+
/// of this software and associated documentation files (the "Software"), to deal
8+
/// in the Software without restriction, including without limitation the rights
9+
/// to use, copy, modify, merge, publish, distribute, sublicense, and/or sell
10+
/// copies of the Software, and to permit persons to whom the Software is
11+
/// furnished to do so, subject to the following conditions:
12+
///
13+
/// The above copyright notice and this permission notice shall be included in all
14+
/// copies or substantial portions of the Software.
15+
///
16+
/// THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR
17+
/// IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY,
18+
/// FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE
19+
/// AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER
20+
/// LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM,
21+
/// OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE
22+
/// SOFTWARE.
423
///
524
/// Created by Sascha Müllner on 24.11.20.
625

Examples/GKMatchMaker/Shared/Views/Authentication/AuthenticationView.swift

Lines changed: 21 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -1,6 +1,25 @@
11
///
2-
/// GKMatchMakerView.swift
3-
/// GKMatchMaker
2+
/// MIT License
3+
///
4+
/// Copyright (c) 2020 Sascha Müllner
5+
///
6+
/// Permission is hereby granted, free of charge, to any person obtaining a copy
7+
/// of this software and associated documentation files (the "Software"), to deal
8+
/// in the Software without restriction, including without limitation the rights
9+
/// to use, copy, modify, merge, publish, distribute, sublicense, and/or sell
10+
/// copies of the Software, and to permit persons to whom the Software is
11+
/// furnished to do so, subject to the following conditions:
12+
///
13+
/// The above copyright notice and this permission notice shall be included in all
14+
/// copies or substantial portions of the Software.
15+
///
16+
/// THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR
17+
/// IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY,
18+
/// FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE
19+
/// AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER
20+
/// LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM,
21+
/// OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE
22+
/// SOFTWARE.
423
///
524
/// Created by smuellner on 22.02.21.
625
///

Examples/GKMatchMaker/Shared/Views/ContentView.swift

Lines changed: 22 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -1,6 +1,25 @@
11
///
2-
/// ContentView.swift
3-
/// GKMatchMaker
2+
/// MIT License
3+
///
4+
/// Copyright (c) 2020 Sascha Müllner
5+
///
6+
/// Permission is hereby granted, free of charge, to any person obtaining a copy
7+
/// of this software and associated documentation files (the "Software"), to deal
8+
/// in the Software without restriction, including without limitation the rights
9+
/// to use, copy, modify, merge, publish, distribute, sublicense, and/or sell
10+
/// copies of the Software, and to permit persons to whom the Software is
11+
/// furnished to do so, subject to the following conditions:
12+
///
13+
/// The above copyright notice and this permission notice shall be included in all
14+
/// copies or substantial portions of the Software.
15+
///
16+
/// THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR
17+
/// IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY,
18+
/// FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE
19+
/// AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER
20+
/// LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM,
21+
/// OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE
22+
/// SOFTWARE.
423
///
524
/// Created by Sascha Müllner on 24.11.20.
625

@@ -20,7 +39,7 @@ struct ContentView: View {
2039
.primaryButtonStyle()
2140
}
2241
NavigationLink(destination: MatchMakingView()) {
23-
Text("Match Making (Sheet)")
42+
Text("Match Making")
2443
.primaryButtonStyle()
2544
}
2645
}

Examples/GKMatchMaker/Shared/Views/MultiPlayer/MatchMakingView.swift

Lines changed: 21 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -1,6 +1,25 @@
11
///
2-
/// GKMatchMakerView.swift
3-
/// GKMatchMaker
2+
/// MIT License
3+
///
4+
/// Copyright (c) 2020 Sascha Müllner
5+
///
6+
/// Permission is hereby granted, free of charge, to any person obtaining a copy
7+
/// of this software and associated documentation files (the "Software"), to deal
8+
/// in the Software without restriction, including without limitation the rights
9+
/// to use, copy, modify, merge, publish, distribute, sublicense, and/or sell
10+
/// copies of the Software, and to permit persons to whom the Software is
11+
/// furnished to do so, subject to the following conditions:
12+
///
13+
/// The above copyright notice and this permission notice shall be included in all
14+
/// copies or substantial portions of the Software.
15+
///
16+
/// THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR
17+
/// IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY,
18+
/// FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE
19+
/// AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER
20+
/// LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM,
21+
/// OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE
22+
/// SOFTWARE.
423
///
524
/// Created by Sascha Müllner on 24.11.20.
625

Examples/GKMatchMaker/Shared/Views/MultiPlayer/MatchView.swift

Lines changed: 49 additions & 15 deletions
Original file line numberDiff line numberDiff line change
@@ -1,11 +1,27 @@
1-
/////
2-
/// MatchView.swift
3-
/// GKMatchmaker
4-
///
1+
///
2+
/// MIT License
3+
///
4+
/// Copyright (c) 2020 Sascha Müllner
5+
///
6+
/// Permission is hereby granted, free of charge, to any person obtaining a copy
7+
/// of this software and associated documentation files (the "Software"), to deal
8+
/// in the Software without restriction, including without limitation the rights
9+
/// to use, copy, modify, merge, publish, distribute, sublicense, and/or sell
10+
/// copies of the Software, and to permit persons to whom the Software is
11+
/// furnished to do so, subject to the following conditions:
12+
///
13+
/// The above copyright notice and this permission notice shall be included in all
14+
/// copies or substantial portions of the Software.
15+
///
16+
/// THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR
17+
/// IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY,
18+
/// FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE
19+
/// AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER
20+
/// LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM,
21+
/// OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE
22+
/// SOFTWARE.
23+
///
524
/// Created by Sascha Müllner on 17.03.21.
6-
/// Unauthorized copying or usage of this file, via any medium is strictly prohibited.
7-
/// Proprietary and confidential.
8-
/// Copyright © 2021 Webblazer EG. All rights reserved.
925

1026
import SwiftUI
1127
import GameKit
@@ -19,17 +35,35 @@ struct MatchView: View {
1935
}
2036

2137
var body: some View {
22-
ZStack {
23-
Color("BackgroundColor").ignoresSafeArea()
24-
VStack() {
25-
ForEach(self.match.players, id: \.self) { player in
26-
Text(player.displayName)
27-
.font(.title)
28-
.padding(8)
38+
NavigationView {
39+
ZStack {
40+
Color("BackgroundColor").ignoresSafeArea()
41+
VStack(alignment: .leading, spacing: 8) {
42+
ForEach(self.match.players, id: \.self) { player in
43+
HStack(alignment: .center, spacing: 8) {
44+
Rectangle()
45+
.background(Color.red)
46+
.frame(width: 42, height: 42)
47+
Text(player.displayName)
48+
.font(.title)
49+
.padding(8)
50+
}
51+
}
2952
}
3053
}
31-
.navigationBarTitle(Text("GameKit Match"))
54+
.navigationBarTitle(Text("GameKit Match"), displayMode: .inline)
55+
.navigationBarItems(trailing:
56+
Button(action: {
57+
GKMatchManager.shared.cancel()
58+
}) {
59+
HStack(alignment: .center) {
60+
Image(systemName: "xmark.circle").imageScale(.large)
61+
Text("Cancel")
62+
}
63+
}
64+
)
3265
}
66+
.navigationViewStyle(StackNavigationViewStyle())
3367
}
3468
}
3569

0 commit comments

Comments
 (0)