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 b7a9ef5..a180af6 100755 --- a/Other Projects/Composing Complex Interfaces/Complete/Landmarks/Landmarks/CategoryRow.swift +++ b/Other Projects/Composing Complex Interfaces/Complete/Landmarks/Landmarks/CategoryRow.swift @@ -18,7 +18,7 @@ struct CategoryRow: View { .padding(.leading, 15) .padding(.top, 5) - ScrollView { + ScrollView(.horizontal) { HStack(alignment: .top, spacing: 0) { ForEach(self.items.identified(by: \.name)) { landmark in NavigationLink( diff --git a/Other Projects/Currency-SwiftUI/Currency-SwiftUI/AddCurrencyView.swift b/Other Projects/Currency-SwiftUI/Currency-SwiftUI/AddCurrencyView.swift index 5e5033a..52595ce 100644 --- a/Other Projects/Currency-SwiftUI/Currency-SwiftUI/AddCurrencyView.swift +++ b/Other Projects/Currency-SwiftUI/Currency-SwiftUI/AddCurrencyView.swift @@ -42,7 +42,7 @@ struct AddCurrencyView : View { } } } - }.navigationBarItem(title: Text("Add Currency")) + }.navigationBarTitle(Text("Add Currency")) } private func select(_ currency: Currency) { diff --git a/Other Projects/Currency-SwiftUI/Currency-SwiftUI/ConverterView.swift b/Other Projects/Currency-SwiftUI/Currency-SwiftUI/ConverterView.swift index 759a841..c8b7c9e 100644 --- a/Other Projects/Currency-SwiftUI/Currency-SwiftUI/ConverterView.swift +++ b/Other Projects/Currency-SwiftUI/Currency-SwiftUI/ConverterView.swift @@ -37,6 +37,7 @@ struct ConverterView : View { let doubleValue: Double = Double(self.$baseAmount.value) ?? 1.0 return ZStack(alignment: Alignment.bottomTrailing) { + NavigationView { VStack(alignment: .leading){ Text("From:").bold().color(.gray) HStack{ @@ -69,7 +70,7 @@ struct ConverterView : View { } } }.onAppear(perform: loadCurrencies) - .navigationBarItem(title: Text("Currenceis 💱")) + .navigationBarTitle(Text("Currencies 💱")) .navigationBarItems(trailing: Button(action: { self.isEditing.toggle() }) { if !self.isEditing { Text("Edit") @@ -77,9 +78,11 @@ struct ConverterView : View { Text("Done").bold() } }) + HStack { Text("Last updated: \(self.lastUpdated)").color(.gray).bold() - } - NavigationButton(destination: AddCurrencyView().environmentObject(self.userData)) { + Spacer() + + NavigationLink(destination: AddCurrencyView().environmentObject(self.userData)) { Text("💰") }.frame(width: 46, height: 46, alignment: .center) .background( @@ -88,6 +91,9 @@ struct ConverterView : View { .border(Color(red: 0.7, green: 0.7, blue: 0.7), width: 1 / UIScreen.main.scale, cornerRadius: 23)) .foregroundColor(.white).font(.largeTitle) }.padding() + } + } + } } private func loadCurrencies() { diff --git a/Other Projects/Currency-SwiftUI/Currency-SwiftUI/SceneDelegate.swift b/Other Projects/Currency-SwiftUI/Currency-SwiftUI/SceneDelegate.swift index ed872a7..d303c30 100644 --- a/Other Projects/Currency-SwiftUI/Currency-SwiftUI/SceneDelegate.swift +++ b/Other Projects/Currency-SwiftUI/Currency-SwiftUI/SceneDelegate.swift @@ -37,12 +37,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: NavigationView { - ConverterView().environmentObject(UserData()) - }) - self.window = window - window.makeKeyAndVisible() + if let windowScene = scene as? UIWindowScene { + let window = UIWindow(windowScene: windowScene) + window.rootViewController = UIHostingController(rootView: ConverterView().environmentObject(UserData())) + self.window = window + window.makeKeyAndVisible() + } } func sceneDidDisconnect(_ scene: UIScene) { diff --git a/Other Projects/Example To-Do App/SwiftUITodo/SceneDelegate.swift b/Other Projects/Example To-Do App/SwiftUITodo/SceneDelegate.swift index 443dfb1..a5a403a 100755 --- a/Other Projects/Example To-Do App/SwiftUITodo/SceneDelegate.swift +++ b/Other Projects/Example To-Do App/SwiftUITodo/SceneDelegate.swift @@ -20,12 +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: NavigationView { - TaskListView().environmentObject(UserData()) - }) - self.window = window - window.makeKeyAndVisible() + if let windowScene = scene as? UIWindowScene { + let window = UIWindow(windowScene: windowScene) + window.rootViewController = UIHostingController(rootView: TaskListView().environmentObject(UserData())) + self.window = window + window.makeKeyAndVisible() + } } func sceneDidDisconnect(_ scene: UIScene) { diff --git a/Other Projects/Example To-Do App/SwiftUITodo/TaskItemView.swift b/Other Projects/Example To-Do App/SwiftUITodo/TaskItemView.swift index e9f9fdd..90eb9b2 100755 --- a/Other Projects/Example To-Do App/SwiftUITodo/TaskItemView.swift +++ b/Other Projects/Example To-Do App/SwiftUITodo/TaskItemView.swift @@ -22,7 +22,7 @@ struct TaskItemView: View { .tapAction(count: 1) { self.delete() } - NavigationButton(destination: TaskEditView(task: task).environmentObject(self.userData)) { + NavigationLink(destination: TaskEditView(task: task).environmentObject(self.userData)) { Text(task.title) } } else { diff --git a/Other Projects/Example To-Do App/SwiftUITodo/TaskListView.swift b/Other Projects/Example To-Do App/SwiftUITodo/TaskListView.swift index 2ddbcd8..99d9965 100755 --- a/Other Projects/Example To-Do App/SwiftUITodo/TaskListView.swift +++ b/Other Projects/Example To-Do App/SwiftUITodo/TaskListView.swift @@ -14,13 +14,14 @@ struct TaskListView: View { @State var isEditing: Bool = false var body: some View { + NavigationView { List { TextField($draftTitle, placeholder: Text("Create a New Task..."), onCommit: self.createTask) ForEach(self.userData.tasks) { task in TaskItemView(task: task, isEditing: self.$isEditing) } } - .navigationBarItem(title: Text("Tasks 👀")) + .navigationBarTitle(Text("Tasks 👀")) .navigationBarItems(trailing: Button(action: { self.isEditing.toggle() }) { if !self.isEditing { Text("Edit") @@ -28,6 +29,7 @@ struct TaskListView: View { Text("Done").bold() } }) + } } private func createTask() { diff --git a/Other Projects/Interfacing With UIKit/Complete/Landmarks/Landmarks/CategoryRow.swift b/Other Projects/Interfacing With UIKit/Complete/Landmarks/Landmarks/CategoryRow.swift index d7e0cb3..a180af6 100755 --- a/Other Projects/Interfacing With UIKit/Complete/Landmarks/Landmarks/CategoryRow.swift +++ b/Other Projects/Interfacing With UIKit/Complete/Landmarks/Landmarks/CategoryRow.swift @@ -18,7 +18,7 @@ struct CategoryRow: View { .padding(.leading, 15) .padding(.top, 5) - ScrollView([]) { + ScrollView(.horizontal) { HStack(alignment: .top, spacing: 0) { ForEach(self.items.identified(by: \.name)) { landmark in NavigationLink( diff --git a/Other Projects/Interfacing With UIKit/Complete/Landmarks/Landmarks/Profiles/ProfileSummary.swift b/Other Projects/Interfacing With UIKit/Complete/Landmarks/Landmarks/Profiles/ProfileSummary.swift index 6d31231..c6eca8f 100755 --- a/Other Projects/Interfacing With UIKit/Complete/Landmarks/Landmarks/Profiles/ProfileSummary.swift +++ b/Other Projects/Interfacing With UIKit/Complete/Landmarks/Landmarks/Profiles/ProfileSummary.swift @@ -31,7 +31,7 @@ struct ProfileSummary: View { VStack(alignment: .leading) { Text("Completed Badges") .font(.headline) - ScrollView { + ScrollView(.horizontal) { HStack { HikeBadge(name: "First Hike") diff --git a/Other Projects/Working With UIControls/Complete/Landmarks/Landmarks/CategoryRow.swift b/Other Projects/Working With UIControls/Complete/Landmarks/Landmarks/CategoryRow.swift index b7a9ef5..a180af6 100755 --- a/Other Projects/Working With UIControls/Complete/Landmarks/Landmarks/CategoryRow.swift +++ b/Other Projects/Working With UIControls/Complete/Landmarks/Landmarks/CategoryRow.swift @@ -18,7 +18,7 @@ struct CategoryRow: View { .padding(.leading, 15) .padding(.top, 5) - ScrollView { + ScrollView(.horizontal) { HStack(alignment: .top, spacing: 0) { ForEach(self.items.identified(by: \.name)) { landmark in NavigationLink( 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 3ec90d5..c6c21b6 100755 --- a/Other Projects/Working With UIControls/Complete/Landmarks/Landmarks/LandmarkList.swift +++ b/Other Projects/Working With UIControls/Complete/Landmarks/Landmarks/LandmarkList.swift @@ -20,7 +20,8 @@ struct LandmarkList: View { ForEach(userData.landmarks) { landmark in if !self.userData.showFavoritesOnly || landmark.isFavorite { NavigationLink( - destination: LandmarkDetail(landmark: landmark)) { + destination: LandmarkDetail(landmark: landmark) + .environmentObject(self.userData)) { LandmarkRow(landmark: landmark) } } diff --git a/Other Projects/Working With UIControls/Complete/Landmarks/Landmarks/Profiles/ProfileSummary.swift b/Other Projects/Working With UIControls/Complete/Landmarks/Landmarks/Profiles/ProfileSummary.swift index 6d31231..c6eca8f 100755 --- a/Other Projects/Working With UIControls/Complete/Landmarks/Landmarks/Profiles/ProfileSummary.swift +++ b/Other Projects/Working With UIControls/Complete/Landmarks/Landmarks/Profiles/ProfileSummary.swift @@ -31,7 +31,7 @@ struct ProfileSummary: View { VStack(alignment: .leading) { Text("Completed Badges") .font(.headline) - ScrollView { + ScrollView(.horizontal) { HStack { HikeBadge(name: "First Hike")