Skip to content

Commit b4a8d02

Browse files
committed
Refactored folder structure
1 parent 8abeb02 commit b4a8d02

17 files changed

Lines changed: 13 additions & 11 deletions

Examples/GKMatchMaker/Shared/GKMatchMakerApp.swift

Lines changed: 4 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -33,13 +33,13 @@ struct GKMatchMakerApp: App {
3333
) {
3434
} failed: { (error) in
3535
self.viewModel.showAlert(title: "Invitation Failed", message: error.localizedDescription)
36-
} started: { (match) in
36+
} started: { (gkMatch) in
3737
self.viewModel.showInvite = false
38-
self.viewModel.match = match
38+
self.viewModel.gkMatch = gkMatch
3939
}
4040
} else if self.viewModel.showMatch,
41-
let match = self.viewModel.match {
42-
MatchView(match)
41+
let gkMatch = self.viewModel.gkMatch {
42+
MatchView(gkMatch)
4343
}
4444
}
4545
}

Examples/GKMatchMaker/Shared/ViewModels/GKMatchMakerAppModel.swift

Lines changed: 4 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -25,7 +25,7 @@ class GKMatchMakerAppModel: ObservableObject {
2525
self.showAuthentication = invite.needsToAuthenticate ?? false
2626
}
2727
}
28-
@Published public var match: GKMatch? {
28+
@Published public var gkMatch: GKMatch? {
2929
didSet {
3030
self.showInvite = false
3131
self.showMatch = true
@@ -43,7 +43,8 @@ class GKMatchMakerAppModel: ObservableObject {
4343
type: .info,
4444
String(describing: notification.name),
4545
String(describing: notification.object),
46-
String(describing: notification.userInfo))
46+
String(describing: notification.userInfo)
47+
)
4748
}
4849
}
4950

@@ -62,7 +63,7 @@ class GKMatchMakerAppModel: ObservableObject {
6263
.shared
6364
.match
6465
.sink { (match) in
65-
self.match = match.gkMatch
66+
self.gkMatch = match.gkMatch
6667
}
6768
}
6869

Package.swift

Lines changed: 2 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -20,7 +20,8 @@ let package = Package(
2020
targets: [
2121
.target(
2222
name: "GameKitUI",
23-
dependencies: []),
23+
dependencies: [],
24+
exclude: ["MetaData", "Examples"]),
2425
.testTarget(
2526
name: "GameKitUITests",
2627
dependencies: ["GameKitUI"])

Sources/GameKitUI/InviteAndMatchManager/GKMatchManager.swift renamed to Sources/GameKitUI/Manager/GKMatchManager.swift

Lines changed: 3 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -70,7 +70,7 @@ public final class GKMatchManager: NSObject {
7070
private var failed: (Error) -> Void = { _ in }
7171
private var started: (GKMatch) -> Void = { _ in }
7272

73-
public func createInvite(invite: GKInvite,
73+
internal func createInvite(invite: GKInvite,
7474
canceled: @escaping () -> Void,
7575
failed: @escaping (Error) -> Void,
7676
started: @escaping (GKMatch) -> Void) -> GKMatchmakerViewController? {
@@ -89,7 +89,7 @@ public final class GKMatchManager: NSObject {
8989
return matchmakerViewController
9090
}
9191

92-
public func createMatchmaker(invite: GKInvite) -> GKMatchmakerViewController? {
92+
internal func createMatchmaker(invite: GKInvite) -> GKMatchmakerViewController? {
9393
guard GKLocalPlayer.local.isAuthenticated,
9494
let matchmakerViewController = GKMatchmakerViewController(invite: invite) else {
9595
GKMatchmaker.shared().cancel()
@@ -100,7 +100,7 @@ public final class GKMatchManager: NSObject {
100100
return matchmakerViewController
101101
}
102102

103-
public func createMatchmaker(request: GKMatchRequest,
103+
internal func createMatchmaker(request: GKMatchRequest,
104104
canceled: @escaping () -> Void,
105105
failed: @escaping (Error) -> Void,
106106
started: @escaping (GKMatch) -> Void) -> GKMatchmakerViewController? {
File renamed without changes.
File renamed without changes.

Sources/GameKitUI/Authentication/GKAuthentication.swift renamed to Sources/GameKitUI/Views/Authentication/GKAuthentication.swift

File renamed without changes.

Sources/GameKitUI/Authentication/GKAuthenticationError.swift renamed to Sources/GameKitUI/Views/Authentication/GKAuthenticationError.swift

File renamed without changes.

Sources/GameKitUI/Authentication/GKAuthenticationView.swift renamed to Sources/GameKitUI/Views/Authentication/GKAuthenticationView.swift

File renamed without changes.

Sources/GameKitUI/Authentication/GKAuthenticationViewController+iOS.swift renamed to Sources/GameKitUI/Views/Authentication/GKAuthenticationViewController+iOS.swift

File renamed without changes.

0 commit comments

Comments
 (0)