From 17a2f3b19626e00323ac1c209d289d20bd1b5f26 Mon Sep 17 00:00:00 2001 From: John Holdsworth Date: Mon, 8 Jul 2019 11:08:29 +0100 Subject: [PATCH] Updated for Xcode 11 Beta3 --- Examples.xcworkspace/contents.xcworkspacedata | 82 +++++++++++++++++++ Other Projects/2048 Game/LICENSE | 0 Other Projects/2048 Game/Screenshot.png | 0 .../Landmarks/Landmarks/LandmarkList.swift | 2 +- .../Landmarks/Landmarks/SceneDelegate.swift | 12 +-- .../Landmarks/Landmarks/LandmarkList.swift | 2 +- .../Landmarks/Landmarks/SceneDelegate.swift | 10 ++- .../Calculator/Calculator/SceneDelegate.swift | 10 ++- .../Landmarks/Landmarks/CategoryRow.swift | 4 +- .../Landmarks/Landmarks/LandmarkList.swift | 2 +- .../Landmarks/Landmarks/SceneDelegate.swift | 10 ++- .../Currency-SwiftUI/ConverterView.swift | 2 +- .../Landmarks/Landmarks/LandmarkList.swift | 2 +- .../Landmarks/Landmarks/SceneDelegate.swift | 12 +-- .../Flux/SwiftUI-Flux/SceneDelegate.swift | 10 ++- .../Landmarks/Landmarks/LandmarkList.swift | 2 +- .../Landmarks/Landmarks/SceneDelegate.swift | 10 ++- .../Instagram-SWUI/ContentView.swift | 2 +- .../Instagram-SWUI/SceneDelegate.swift | 12 +-- .../Landmarks/Landmarks/LandmarkList.swift | 2 +- .../Jike/SwiftUI_Jike/Cell/CategoryRow.swift | 2 +- .../Jike/SwiftUI_Jike/SceneDelegate.swift | 10 ++- .../MovieSwift/flux/state/AppState.swift | 4 +- .../MovieSwift/launch/SceneDelegate.swift | 10 ++- .../SwiftUIDemo/SceneDelegate.swift | 10 ++- .../views/users/UsersListView.swift | 2 +- .../Tempus RomanumIl/TempusRomanum/Home.swift | 1 + .../TempusRomanum/SceneDelegate.swift | 10 ++- .../SwiftUITimeTravel/SceneDelegate.swift | 10 ++- .../SceneDelegate.swift | 10 ++- .../SwiftUI-CardAnimation/SceneDelegate.swift | 10 ++- .../UINote/SwiftUINote/SceneDelegate.swift | 12 +-- .../UINote/SwiftUINote/Views/NoteList.swift | 2 +- .../WWDCPlayer/Delegates/SceneDelegate.swift | 12 +-- .../Landmarks/Landmarks/LandmarkList.swift | 2 +- 35 files changed, 207 insertions(+), 88 deletions(-) create mode 100644 Examples.xcworkspace/contents.xcworkspacedata create mode 100644 Other Projects/2048 Game/LICENSE create mode 100644 Other Projects/2048 Game/Screenshot.png diff --git a/Examples.xcworkspace/contents.xcworkspacedata b/Examples.xcworkspace/contents.xcworkspacedata new file mode 100644 index 0000000..9ab944b --- /dev/null +++ b/Examples.xcworkspace/contents.xcworkspacedata @@ -0,0 +1,82 @@ + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + diff --git a/Other Projects/2048 Game/LICENSE b/Other Projects/2048 Game/LICENSE new file mode 100644 index 0000000..e69de29 diff --git a/Other Projects/2048 Game/Screenshot.png b/Other Projects/2048 Game/Screenshot.png new file mode 100644 index 0000000..e69de29 diff --git a/Other Projects/Animating Views And Transitions/Complete/Landmarks/Landmarks/LandmarkList.swift b/Other Projects/Animating Views And Transitions/Complete/Landmarks/Landmarks/LandmarkList.swift index c17b5f3..3ec90d5 100755 --- a/Other Projects/Animating Views And Transitions/Complete/Landmarks/Landmarks/LandmarkList.swift +++ b/Other Projects/Animating Views And Transitions/Complete/Landmarks/Landmarks/LandmarkList.swift @@ -19,7 +19,7 @@ struct LandmarkList: View { ForEach(userData.landmarks) { landmark in if !self.userData.showFavoritesOnly || landmark.isFavorite { - NavigationButton( + NavigationLink( destination: LandmarkDetail(landmark: landmark)) { LandmarkRow(landmark: landmark) } diff --git a/Other Projects/Animating Views And Transitions/Complete/Landmarks/Landmarks/SceneDelegate.swift b/Other Projects/Animating Views And Transitions/Complete/Landmarks/Landmarks/SceneDelegate.swift index 96df0dc..ef7f251 100755 --- a/Other Projects/Animating Views And Transitions/Complete/Landmarks/Landmarks/SceneDelegate.swift +++ b/Other Projects/Animating Views And Transitions/Complete/Landmarks/Landmarks/SceneDelegate.swift @@ -18,11 +18,13 @@ class SceneDelegate: UIResponder, UIWindowSceneDelegate { // This delegate does not imply the connecting scene or session are new (see `application:configurationForConnectingSceneSession` instead). // Use a UIHostingController as window root view controller - let window = UIWindow(frame: UIScreen.main.bounds) - window.rootViewController = UIHostingController(rootView: LandmarkList().environmentObject(UserData())) - self.window = window - window.makeKeyAndVisible() - } + if let windowScene = scene as? UIWindowScene { + let window = UIWindow(windowScene: windowScene) + window.rootViewController = UIHostingController(rootView: LandmarkList().environmentObject(UserData())) + self.window = window + window.makeKeyAndVisible() + } + } func sceneDidDisconnect(_ scene: UIScene) { // Called as the scene is being released by the system. diff --git a/Other Projects/Building Lists And Navigation/Complete/Landmarks/Landmarks/LandmarkList.swift b/Other Projects/Building Lists And Navigation/Complete/Landmarks/Landmarks/LandmarkList.swift index 1c5b7ee..687e142 100755 --- a/Other Projects/Building Lists And Navigation/Complete/Landmarks/Landmarks/LandmarkList.swift +++ b/Other Projects/Building Lists And Navigation/Complete/Landmarks/Landmarks/LandmarkList.swift @@ -11,7 +11,7 @@ struct LandmarkList: View { var body: some View { NavigationView { List(landmarkData) { landmark in - NavigationButton(destination: LandmarkDetail(landmark: landmark)) { + NavigationLink(destination: LandmarkDetail(landmark: landmark)) { LandmarkRow(landmark: landmark) } } diff --git a/Other Projects/Building Lists And Navigation/Complete/Landmarks/Landmarks/SceneDelegate.swift b/Other Projects/Building Lists And Navigation/Complete/Landmarks/Landmarks/SceneDelegate.swift index c4d69a9..8695ad0 100755 --- a/Other Projects/Building Lists And Navigation/Complete/Landmarks/Landmarks/SceneDelegate.swift +++ b/Other Projects/Building Lists And Navigation/Complete/Landmarks/Landmarks/SceneDelegate.swift @@ -18,10 +18,12 @@ class SceneDelegate: UIResponder, UIWindowSceneDelegate { // This delegate does not imply the connecting scene or session are new (see `application:configurationForConnectingSceneSession` instead). // Use a UIHostingController as window root view controller - let window = UIWindow(frame: UIScreen.main.bounds) - window.rootViewController = UIHostingController(rootView: LandmarkList()) - self.window = window - window.makeKeyAndVisible() + if let windowScene = scene as? UIWindowScene { + let window = UIWindow(windowScene: windowScene) + window.rootViewController = UIHostingController(rootView: LandmarkList()) + self.window = window + window.makeKeyAndVisible() + } } func sceneDidDisconnect(_ scene: UIScene) { diff --git a/Other Projects/Calculator/Calculator/Calculator/SceneDelegate.swift b/Other Projects/Calculator/Calculator/Calculator/SceneDelegate.swift index a61f029..162e0e4 100755 --- a/Other Projects/Calculator/Calculator/Calculator/SceneDelegate.swift +++ b/Other Projects/Calculator/Calculator/Calculator/SceneDelegate.swift @@ -20,10 +20,12 @@ class SceneDelegate: UIResponder, UIWindowSceneDelegate { // This delegate does not imply the connecting scene or session are new (see `application:configurationForConnectingSceneSession` instead). // Use a UIHostingController as window root view controller - let window = UIWindow(frame: UIScreen.main.bounds) - window.rootViewController = UIHostingController(rootView: Calculator()) - self.window = window - window.makeKeyAndVisible() + if let windowScene = scene as? UIWindowScene { + let window = UIWindow(windowScene: windowScene) + window.rootViewController = UIHostingController(rootView: Calculator()) + self.window = window + window.makeKeyAndVisible() + } } func sceneDidDisconnect(_ scene: UIScene) { diff --git a/Other Projects/Composing Complex Interfaces/Complete/Landmarks/Landmarks/CategoryRow.swift b/Other Projects/Composing Complex Interfaces/Complete/Landmarks/Landmarks/CategoryRow.swift index 1f4fbd8..d511ffa 100755 --- a/Other Projects/Composing Complex Interfaces/Complete/Landmarks/Landmarks/CategoryRow.swift +++ b/Other Projects/Composing Complex Interfaces/Complete/Landmarks/Landmarks/CategoryRow.swift @@ -12,7 +12,7 @@ struct CategoryRow: View { var items: [Landmark] var body: some View { - VStack(alignment: .leading) { + VStack(alignment: HorizontalAlignment.leading) { Text(self.categoryName) .font(.headline) .padding(.leading, 15) @@ -21,7 +21,7 @@ struct CategoryRow: View { ScrollView(showsHorizontalIndicator: false) { HStack(alignment: .top, spacing: 0) { ForEach(self.items.identified(by: \.name)) { landmark in - NavigationButton( + NavigationLink( destination: LandmarkDetail( landmark: landmark ) diff --git a/Other Projects/Composing Complex Interfaces/Complete/Landmarks/Landmarks/LandmarkList.swift b/Other Projects/Composing Complex Interfaces/Complete/Landmarks/Landmarks/LandmarkList.swift index c17b5f3..3ec90d5 100755 --- a/Other Projects/Composing Complex Interfaces/Complete/Landmarks/Landmarks/LandmarkList.swift +++ b/Other Projects/Composing Complex Interfaces/Complete/Landmarks/Landmarks/LandmarkList.swift @@ -19,7 +19,7 @@ struct LandmarkList: View { ForEach(userData.landmarks) { landmark in if !self.userData.showFavoritesOnly || landmark.isFavorite { - NavigationButton( + NavigationLink( destination: LandmarkDetail(landmark: landmark)) { LandmarkRow(landmark: landmark) } diff --git a/Other Projects/Creating And Combining Views/Complete/Landmarks/Landmarks/SceneDelegate.swift b/Other Projects/Creating And Combining Views/Complete/Landmarks/Landmarks/SceneDelegate.swift index 8822243..3c52902 100755 --- a/Other Projects/Creating And Combining Views/Complete/Landmarks/Landmarks/SceneDelegate.swift +++ b/Other Projects/Creating And Combining Views/Complete/Landmarks/Landmarks/SceneDelegate.swift @@ -18,10 +18,12 @@ class SceneDelegate: UIResponder, UIWindowSceneDelegate { // This delegate does not imply the connecting scene or session are new (see `application:configurationForConnectingSceneSession` instead). // Use a UIHostingController as window root view controller - let window = UIWindow(frame: UIScreen.main.bounds) - window.rootViewController = UIHostingController(rootView: ContentView()) - self.window = window - window.makeKeyAndVisible() + if let windowScene = scene as? UIWindowScene { + let window = UIWindow(windowScene: windowScene) + window.rootViewController = UIHostingController(rootView: ContentView()) + self.window = window + window.makeKeyAndVisible() + } } func sceneDidDisconnect(_ scene: UIScene) { diff --git a/Other Projects/Currency-SwiftUI/Currency-SwiftUI/ConverterView.swift b/Other Projects/Currency-SwiftUI/Currency-SwiftUI/ConverterView.swift index 1b0f1c1..759a841 100644 --- a/Other Projects/Currency-SwiftUI/Currency-SwiftUI/ConverterView.swift +++ b/Other Projects/Currency-SwiftUI/Currency-SwiftUI/ConverterView.swift @@ -36,7 +36,7 @@ struct ConverterView : View { let inset = EdgeInsets(top: -8, leading: -20, bottom: -7, trailing: 5) let doubleValue: Double = Double(self.$baseAmount.value) ?? 1.0 - return ZStack(alignment: .bottomTrailing) { + return ZStack(alignment: Alignment.bottomTrailing) { VStack(alignment: .leading){ Text("From:").bold().color(.gray) HStack{ diff --git a/Other Projects/Drawing Paths And Shapes/Complete/Landmarks/Landmarks/LandmarkList.swift b/Other Projects/Drawing Paths And Shapes/Complete/Landmarks/Landmarks/LandmarkList.swift index c17b5f3..3ec90d5 100755 --- a/Other Projects/Drawing Paths And Shapes/Complete/Landmarks/Landmarks/LandmarkList.swift +++ b/Other Projects/Drawing Paths And Shapes/Complete/Landmarks/Landmarks/LandmarkList.swift @@ -19,7 +19,7 @@ struct LandmarkList: View { ForEach(userData.landmarks) { landmark in if !self.userData.showFavoritesOnly || landmark.isFavorite { - NavigationButton( + NavigationLink( destination: LandmarkDetail(landmark: landmark)) { LandmarkRow(landmark: landmark) } diff --git a/Other Projects/Drawing Paths And Shapes/Complete/Landmarks/Landmarks/SceneDelegate.swift b/Other Projects/Drawing Paths And Shapes/Complete/Landmarks/Landmarks/SceneDelegate.swift index 96df0dc..ef7f251 100755 --- a/Other Projects/Drawing Paths And Shapes/Complete/Landmarks/Landmarks/SceneDelegate.swift +++ b/Other Projects/Drawing Paths And Shapes/Complete/Landmarks/Landmarks/SceneDelegate.swift @@ -18,11 +18,13 @@ class SceneDelegate: UIResponder, UIWindowSceneDelegate { // This delegate does not imply the connecting scene or session are new (see `application:configurationForConnectingSceneSession` instead). // Use a UIHostingController as window root view controller - let window = UIWindow(frame: UIScreen.main.bounds) - window.rootViewController = UIHostingController(rootView: LandmarkList().environmentObject(UserData())) - self.window = window - window.makeKeyAndVisible() - } + if let windowScene = scene as? UIWindowScene { + let window = UIWindow(windowScene: windowScene) + window.rootViewController = UIHostingController(rootView: LandmarkList().environmentObject(UserData())) + self.window = window + window.makeKeyAndVisible() + } + } func sceneDidDisconnect(_ scene: UIScene) { // Called as the scene is being released by the system. diff --git a/Other Projects/Flux/SwiftUI-Flux/SceneDelegate.swift b/Other Projects/Flux/SwiftUI-Flux/SceneDelegate.swift index 577877f..65209b4 100755 --- a/Other Projects/Flux/SwiftUI-Flux/SceneDelegate.swift +++ b/Other Projects/Flux/SwiftUI-Flux/SceneDelegate.swift @@ -5,9 +5,11 @@ final class SceneDelegate: UIResponder, UIWindowSceneDelegate { var window: UIWindow? func scene(_ scene: UIScene, willConnectTo session: UISceneSession, options connectionOptions: UIScene.ConnectionOptions) { - let window = UIWindow(frame: UIScreen.main.bounds) - window.rootViewController = UIHostingController(rootView: CounterView()) - self.window = window - window.makeKeyAndVisible() + if let windowScene = scene as? UIWindowScene { + let window = UIWindow(windowScene: windowScene) + window.rootViewController = UIHostingController(rootView: CounterView()) + self.window = window + window.makeKeyAndVisible() + } } } diff --git a/Other Projects/Handling User Input/Complete/Landmarks/Landmarks/LandmarkList.swift b/Other Projects/Handling User Input/Complete/Landmarks/Landmarks/LandmarkList.swift index c17b5f3..3ec90d5 100755 --- a/Other Projects/Handling User Input/Complete/Landmarks/Landmarks/LandmarkList.swift +++ b/Other Projects/Handling User Input/Complete/Landmarks/Landmarks/LandmarkList.swift @@ -19,7 +19,7 @@ struct LandmarkList: View { ForEach(userData.landmarks) { landmark in if !self.userData.showFavoritesOnly || landmark.isFavorite { - NavigationButton( + NavigationLink( destination: LandmarkDetail(landmark: landmark)) { LandmarkRow(landmark: landmark) } diff --git a/Other Projects/Handling User Input/Complete/Landmarks/Landmarks/SceneDelegate.swift b/Other Projects/Handling User Input/Complete/Landmarks/Landmarks/SceneDelegate.swift index 96df0dc..a1104cc 100755 --- a/Other Projects/Handling User Input/Complete/Landmarks/Landmarks/SceneDelegate.swift +++ b/Other Projects/Handling User Input/Complete/Landmarks/Landmarks/SceneDelegate.swift @@ -18,10 +18,12 @@ class SceneDelegate: UIResponder, UIWindowSceneDelegate { // This delegate does not imply the connecting scene or session are new (see `application:configurationForConnectingSceneSession` instead). // Use a UIHostingController as window root view controller - let window = UIWindow(frame: UIScreen.main.bounds) - window.rootViewController = UIHostingController(rootView: LandmarkList().environmentObject(UserData())) - self.window = window - window.makeKeyAndVisible() + if let windowScene = scene as? UIWindowScene { + let window = UIWindow(windowScene: windowScene) + window.rootViewController = UIHostingController(rootView: LandmarkList().environmentObject(UserData())) + self.window = window + window.makeKeyAndVisible() + } } func sceneDidDisconnect(_ scene: UIScene) { diff --git a/Other Projects/InstaFake/Instagram-SWUI/ContentView.swift b/Other Projects/InstaFake/Instagram-SWUI/ContentView.swift index 82db78a..4054262 100755 --- a/Other Projects/InstaFake/Instagram-SWUI/ContentView.swift +++ b/Other Projects/InstaFake/Instagram-SWUI/ContentView.swift @@ -19,7 +19,7 @@ struct ContentView : View { ForEach(instaPhotos.identified(by: \.id)) { ImageCell(photo: $0) } - }.navigationBarTitle(Text("WWDC")).navigationBarItems(trailing: PresentationButton(Text("Camera"), destination: CameraView())) + }.navigationBarTitle("WWDC").navigationBarItems(trailing: PresentationLink("Camera", destination: CameraView())) } } diff --git a/Other Projects/InstaFake/Instagram-SWUI/SceneDelegate.swift b/Other Projects/InstaFake/Instagram-SWUI/SceneDelegate.swift index 4737cb5..5c84857 100755 --- a/Other Projects/InstaFake/Instagram-SWUI/SceneDelegate.swift +++ b/Other Projects/InstaFake/Instagram-SWUI/SceneDelegate.swift @@ -20,11 +20,13 @@ class SceneDelegate: UIResponder, UIWindowSceneDelegate { // This delegate does not imply the connecting scene or session are new (see `application:configurationForConnectingSceneSession` instead). // Use a UIHostingController as window root view controller - let window = UIWindow(frame: UIScreen.main.bounds) - window.rootViewController = UIHostingController(rootView: ContentView(instaPhotos: [InstaPhoto(id: 0, username: "leavenstee", comments: ["Nice", "Cool","Lame"], likes: 100, image: "wwdc"),InstaPhoto(id: 0, username: "leavenstee", comments: ["Nice", "Cool","Lame","Nice", "Cool","Lame"], likes: 200, image: "pizza"), - InstaPhoto(id: 0, username: "leavenstee", comments: ["Nice", "Cool","Lame","Nice", "Cool","Lame","Nice", "Cool","Lame","Nice", "Cool","Lame"], likes: 4440, image: "wwdc"),InstaPhoto(id: 0, username: "leavenstee", comments: ["Nice", "Cool"], likes: 20, image: "badge")])) - self.window = window - window.makeKeyAndVisible() + if let windowScene = scene as? UIWindowScene { + let window = UIWindow(windowScene: windowScene) + window.rootViewController = UIHostingController(rootView: ContentView(instaPhotos: [InstaPhoto(id: 0, username: "leavenstee", comments: ["Nice", "Cool","Lame"], likes: 100, image: "wwdc"),InstaPhoto(id: 0, username: "leavenstee", comments: ["Nice", "Cool","Lame","Nice", "Cool","Lame"], likes: 200, image: "pizza"), + InstaPhoto(id: 0, username: "leavenstee", comments: ["Nice", "Cool","Lame","Nice", "Cool","Lame","Nice", "Cool","Lame","Nice", "Cool","Lame"], likes: 4440, image: "wwdc"),InstaPhoto(id: 0, username: "leavenstee", comments: ["Nice", "Cool"], likes: 20, image: "badge")])) + self.window = window + window.makeKeyAndVisible() + } } func sceneDidDisconnect(_ scene: UIScene) { diff --git a/Other Projects/Interfacing With UIKit/Complete/Landmarks/Landmarks/LandmarkList.swift b/Other Projects/Interfacing With UIKit/Complete/Landmarks/Landmarks/LandmarkList.swift index c17b5f3..3ec90d5 100755 --- a/Other Projects/Interfacing With UIKit/Complete/Landmarks/Landmarks/LandmarkList.swift +++ b/Other Projects/Interfacing With UIKit/Complete/Landmarks/Landmarks/LandmarkList.swift @@ -19,7 +19,7 @@ struct LandmarkList: View { ForEach(userData.landmarks) { landmark in if !self.userData.showFavoritesOnly || landmark.isFavorite { - NavigationButton( + NavigationLink( destination: LandmarkDetail(landmark: landmark)) { LandmarkRow(landmark: landmark) } diff --git a/Other Projects/Jike/SwiftUI_Jike/Cell/CategoryRow.swift b/Other Projects/Jike/SwiftUI_Jike/Cell/CategoryRow.swift index 267e96c..d533148 100755 --- a/Other Projects/Jike/SwiftUI_Jike/Cell/CategoryRow.swift +++ b/Other Projects/Jike/SwiftUI_Jike/Cell/CategoryRow.swift @@ -12,7 +12,7 @@ struct CategoryRow: View { var body: some View { VStack(alignment: .leading) { - ScrollView(showsHorizontalIndicator: false) { + ScrollView(.horizontal) { HStack(alignment: .top, spacing: 0) { ForEach(self.items.identified(by: \.id)) { zone in CategoryItem(zone: zone) diff --git a/Other Projects/Jike/SwiftUI_Jike/SceneDelegate.swift b/Other Projects/Jike/SwiftUI_Jike/SceneDelegate.swift index 574b38a..ba17391 100755 --- a/Other Projects/Jike/SwiftUI_Jike/SceneDelegate.swift +++ b/Other Projects/Jike/SwiftUI_Jike/SceneDelegate.swift @@ -20,10 +20,12 @@ class SceneDelegate: UIResponder, UIWindowSceneDelegate { // This delegate does not imply the connecting scene or session are new (see `application:configurationForConnectingSceneSession` instead). // Use a UIHostingController as window root view controller - let window = UIWindow(frame: UIScreen.main.bounds) - window.rootViewController = UIHostingController(rootView: ContentView()) - self.window = window - window.makeKeyAndVisible() + if let windowScene = scene as? UIWindowScene { + let window = UIWindow(windowScene: windowScene) + window.rootViewController = UIHostingController(rootView: ContentView()) + self.window = window + window.makeKeyAndVisible() + } } func sceneDidDisconnect(_ scene: UIScene) { diff --git a/Other Projects/Movie/MovieSwift/MovieSwift/flux/state/AppState.swift b/Other Projects/Movie/MovieSwift/MovieSwift/flux/state/AppState.swift index 2a49156..1b14469 100755 --- a/Other Projects/Movie/MovieSwift/MovieSwift/flux/state/AppState.swift +++ b/Other Projects/Movie/MovieSwift/MovieSwift/flux/state/AppState.swift @@ -21,7 +21,9 @@ final class AppState: BindableObject { func dispatch(action: Action) { moviesState = MoviesStateReducer().reduce(state: moviesState, action: action) - didChange.send(self) + DispatchQueue.main.async { + self.didChange.send(self) + } } } diff --git a/Other Projects/Movie/MovieSwift/MovieSwift/launch/SceneDelegate.swift b/Other Projects/Movie/MovieSwift/MovieSwift/launch/SceneDelegate.swift index ccb275e..a4442c3 100755 --- a/Other Projects/Movie/MovieSwift/MovieSwift/launch/SceneDelegate.swift +++ b/Other Projects/Movie/MovieSwift/MovieSwift/launch/SceneDelegate.swift @@ -20,10 +20,12 @@ class SceneDelegate: UIResponder, UIWindowSceneDelegate { // This delegate does not imply the connecting scene or session are new (see `application:configurationForConnectingSceneSession` instead). // Use a UIHostingController as window root view controller - let window = UIWindow(frame: UIScreen.main.bounds) - window.rootViewController = UIHostingController(rootView: ContentView().environmentObject(store)) - self.window = window - window.makeKeyAndVisible() + if let windowScene = scene as? UIWindowScene { + let window = UIWindow(windowScene: windowScene) + window.rootViewController = UIHostingController(rootView: ContentView().environmentObject(store)) + self.window = window + window.makeKeyAndVisible() + } } func sceneDidDisconnect(_ scene: UIScene) { diff --git a/Other Projects/SwiftUI + Redux/SwiftUIDemo/SceneDelegate.swift b/Other Projects/SwiftUI + Redux/SwiftUIDemo/SceneDelegate.swift index 76089c0..5c0bea8 100755 --- a/Other Projects/SwiftUI + Redux/SwiftUIDemo/SceneDelegate.swift +++ b/Other Projects/SwiftUI + Redux/SwiftUIDemo/SceneDelegate.swift @@ -15,10 +15,12 @@ class SceneDelegate: UIResponder, UIWindowSceneDelegate { func scene(_ scene: UIScene, willConnectTo session: UISceneSession, options connectionOptions: UIScene.ConnectionOptions) { - let window = UIWindow(frame: UIScreen.main.bounds) - window.rootViewController = UIHostingController(rootView: TabbarView().environmentObject(store)) - self.window = window - window.makeKeyAndVisible() + if let windowScene = scene as? UIWindowScene { + let window = UIWindow(windowScene: windowScene) + window.rootViewController = UIHostingController(rootView: TabbarView().environmentObject(store)) + self.window = window + window.makeKeyAndVisible() + } } } diff --git a/Other Projects/SwiftUI + Redux/SwiftUIDemo/views/users/UsersListView.swift b/Other Projects/SwiftUI + Redux/SwiftUIDemo/views/users/UsersListView.swift index f13f810..20ac0dd 100755 --- a/Other Projects/SwiftUI + Redux/SwiftUIDemo/views/users/UsersListView.swift +++ b/Other Projects/SwiftUI + Redux/SwiftUIDemo/views/users/UsersListView.swift @@ -24,7 +24,7 @@ struct UsersListView : View { } Section { ForEach(state.usersState.users) {user in - NavigationButton(destination: UserDetailView(userId: user.id)) { + NavigationLink(destination: UserDetailView(userId: user.id)) { UserRow(user: user) } } diff --git a/Other Projects/Tempus RomanumIl/TempusRomanum/Home.swift b/Other Projects/Tempus RomanumIl/TempusRomanum/Home.swift index 2382ca2..ec44aa1 100755 --- a/Other Projects/Tempus RomanumIl/TempusRomanum/Home.swift +++ b/Other Projects/Tempus RomanumIl/TempusRomanum/Home.swift @@ -6,6 +6,7 @@ struct Home : View { var body: some View { VStack { Text("Hello World") + ClockView() } } } diff --git a/Other Projects/Tempus RomanumIl/TempusRomanum/SceneDelegate.swift b/Other Projects/Tempus RomanumIl/TempusRomanum/SceneDelegate.swift index 55ab9e5..537a5f5 100755 --- a/Other Projects/Tempus RomanumIl/TempusRomanum/SceneDelegate.swift +++ b/Other Projects/Tempus RomanumIl/TempusRomanum/SceneDelegate.swift @@ -14,10 +14,12 @@ class SceneDelegate: UIResponder, UIWindowSceneDelegate { // This delegate does not imply the connecting scene or session are new (see `application:configurationForConnectingSceneSession` instead). // Use a UIHostingController as window root view controller - let window = UIWindow(frame: UIScreen.main.bounds) - window.rootViewController = UIHostingController(rootView: Home()) - self.window = window - window.makeKeyAndVisible() + if let windowScene = scene as? UIWindowScene { + let window = UIWindow(windowScene: windowScene) + window.rootViewController = UIHostingController(rootView: Home()) + self.window = window + window.makeKeyAndVisible() + } } func sceneDidDisconnect(_ scene: UIScene) { diff --git a/Other Projects/Time Travel/SwiftUITimeTravel/SceneDelegate.swift b/Other Projects/Time Travel/SwiftUITimeTravel/SceneDelegate.swift index a26d136..24e499e 100755 --- a/Other Projects/Time Travel/SwiftUITimeTravel/SceneDelegate.swift +++ b/Other Projects/Time Travel/SwiftUITimeTravel/SceneDelegate.swift @@ -12,10 +12,12 @@ class SceneDelegate: UIResponder, UIWindowSceneDelegate { // This delegate does not imply the connecting scene or session are new (see `application:configurationForConnectingSceneSession` instead). // Use a UIHostingController as window root view controller - let window = UIWindow(frame: UIScreen.main.bounds) - window.rootViewController = UIHostingController(rootView: ContentView()) - self.window = window - window.makeKeyAndVisible() + if let windowScene = scene as? UIWindowScene { + let window = UIWindow(windowScene: windowScene) + window.rootViewController = UIHostingController(rootView: ContentView()) + self.window = window + window.makeKeyAndVisible() + } } func sceneDidDisconnect(_ scene: UIScene) { diff --git a/Other Projects/Transition and Blur/Basic Animation/SwiftUI-BasicAnimation/SceneDelegate.swift b/Other Projects/Transition and Blur/Basic Animation/SwiftUI-BasicAnimation/SceneDelegate.swift index 965719f..9ce0628 100644 --- a/Other Projects/Transition and Blur/Basic Animation/SwiftUI-BasicAnimation/SceneDelegate.swift +++ b/Other Projects/Transition and Blur/Basic Animation/SwiftUI-BasicAnimation/SceneDelegate.swift @@ -20,10 +20,12 @@ class SceneDelegate: UIResponder, UIWindowSceneDelegate { // This delegate does not imply the connecting scene or session are new (see `application:configurationForConnectingSceneSession` instead). // Use a UIHostingController as window root view controller - let window = UIWindow(frame: UIScreen.main.bounds) - window.rootViewController = UIHostingController(rootView: ContentView()) - self.window = window - window.makeKeyAndVisible() + if let windowScene = scene as? UIWindowScene { + let window = UIWindow(windowScene: windowScene) + window.rootViewController = UIHostingController(rootView: ContentView()) + self.window = window + window.makeKeyAndVisible() + } } func sceneDidDisconnect(_ scene: UIScene) { diff --git a/Other Projects/Transition and Blur/Card Animation/SwiftUI-CardAnimation/SceneDelegate.swift b/Other Projects/Transition and Blur/Card Animation/SwiftUI-CardAnimation/SceneDelegate.swift index c6f1740..0cb85e8 100644 --- a/Other Projects/Transition and Blur/Card Animation/SwiftUI-CardAnimation/SceneDelegate.swift +++ b/Other Projects/Transition and Blur/Card Animation/SwiftUI-CardAnimation/SceneDelegate.swift @@ -20,10 +20,12 @@ class SceneDelegate: UIResponder, UIWindowSceneDelegate { // This delegate does not imply the connecting scene or session are new (see `application:configurationForConnectingSceneSession` instead). // Use a UIHostingController as window root view controller - let window = UIWindow(frame: UIScreen.main.bounds) - window.rootViewController = UIHostingController(rootView: ContentView()) - self.window = window - window.makeKeyAndVisible() + if let windowScene = scene as? UIWindowScene { + let window = UIWindow(windowScene: windowScene) + window.rootViewController = UIHostingController(rootView: ContentView()) + self.window = window + window.makeKeyAndVisible() + } } func sceneDidDisconnect(_ scene: UIScene) { diff --git a/Other Projects/UINote/SwiftUINote/SceneDelegate.swift b/Other Projects/UINote/SwiftUINote/SceneDelegate.swift index 93adb9e..eeb7334 100755 --- a/Other Projects/UINote/SwiftUINote/SceneDelegate.swift +++ b/Other Projects/UINote/SwiftUINote/SceneDelegate.swift @@ -20,11 +20,13 @@ class SceneDelegate: UIResponder, UIWindowSceneDelegate { // This delegate does not imply the connecting scene or session are new (see `application:configurationForConnectingSceneSession` instead). // Use a UIHostingController as window root view controller - let window = UIWindow(frame: UIScreen.main.bounds) - window.rootViewController = UIHostingController(rootView: NoteList() - .environmentObject(UserData())) - self.window = window - window.makeKeyAndVisible() + if let windowScene = scene as? UIWindowScene { + let window = UIWindow(windowScene: windowScene) + window.rootViewController = UIHostingController(rootView: NoteList() + .environmentObject(UserData())) + self.window = window + window.makeKeyAndVisible() + } } func sceneDidDisconnect(_ scene: UIScene) { diff --git a/Other Projects/UINote/SwiftUINote/Views/NoteList.swift b/Other Projects/UINote/SwiftUINote/Views/NoteList.swift index 84a3605..0f70f48 100755 --- a/Other Projects/UINote/SwiftUINote/Views/NoteList.swift +++ b/Other Projects/UINote/SwiftUINote/Views/NoteList.swift @@ -14,7 +14,7 @@ struct NoteList : View { var body: some View { NavigationView { List(userData.notes) { note in - NavigationButton(destination: NoteDetail(note: note)) { + NavigationLink(destination: NoteDetail(note: note)) { NoteRow(note: note) } } diff --git a/Other Projects/WWDCPlayer/WWDCPlayer/Delegates/SceneDelegate.swift b/Other Projects/WWDCPlayer/WWDCPlayer/Delegates/SceneDelegate.swift index 62d2b10..65fd6ad 100755 --- a/Other Projects/WWDCPlayer/WWDCPlayer/Delegates/SceneDelegate.swift +++ b/Other Projects/WWDCPlayer/WWDCPlayer/Delegates/SceneDelegate.swift @@ -20,11 +20,13 @@ class SceneDelegate: UIResponder, UIWindowSceneDelegate { // This delegate does not imply the connecting scene or session are new (see `application:configurationForConnectingSceneSession` instead). // Use a UIHostingController as window root view controller - let window = UIWindow(frame: UIScreen.main.bounds) - window.rootViewController = UIHostingController(rootView: MainView() - .environmentObject(UserData())) - self.window = window - window.makeKeyAndVisible() + if let windowScene = scene as? UIWindowScene { + let window = UIWindow(windowScene: windowScene) + window.rootViewController = UIHostingController(rootView: MainView() + .environmentObject(UserData())) + self.window = window + window.makeKeyAndVisible() + } } func sceneDidDisconnect(_ scene: UIScene) { diff --git a/Other Projects/Working With UIControls/Complete/Landmarks/Landmarks/LandmarkList.swift b/Other Projects/Working With UIControls/Complete/Landmarks/Landmarks/LandmarkList.swift index c17b5f3..3ec90d5 100755 --- a/Other Projects/Working With UIControls/Complete/Landmarks/Landmarks/LandmarkList.swift +++ b/Other Projects/Working With UIControls/Complete/Landmarks/Landmarks/LandmarkList.swift @@ -19,7 +19,7 @@ struct LandmarkList: View { ForEach(userData.landmarks) { landmark in if !self.userData.showFavoritesOnly || landmark.isFavorite { - NavigationButton( + NavigationLink( destination: LandmarkDetail(landmark: landmark)) { LandmarkRow(landmark: landmark) }