diff --git a/NiceArchitectureExample/NiceArchitectureExample.xcodeproj/project.pbxproj b/NiceArchitectureExample/NiceArchitectureExample.xcodeproj/project.pbxproj index 514a8da..c95588f 100644 --- a/NiceArchitectureExample/NiceArchitectureExample.xcodeproj/project.pbxproj +++ b/NiceArchitectureExample/NiceArchitectureExample.xcodeproj/project.pbxproj @@ -598,7 +598,7 @@ GCC_WARN_UNINITIALIZED_AUTOS = YES_AGGRESSIVE; GCC_WARN_UNUSED_FUNCTION = YES; GCC_WARN_UNUSED_VARIABLE = YES; - IPHONEOS_DEPLOYMENT_TARGET = 15.0; + IPHONEOS_DEPLOYMENT_TARGET = 17.0; MTL_ENABLE_DEBUG_INFO = INCLUDE_SOURCE; MTL_FAST_MATH = YES; ONLY_ACTIVE_ARCH = YES; @@ -654,7 +654,7 @@ GCC_WARN_UNINITIALIZED_AUTOS = YES_AGGRESSIVE; GCC_WARN_UNUSED_FUNCTION = YES; GCC_WARN_UNUSED_VARIABLE = YES; - IPHONEOS_DEPLOYMENT_TARGET = 15.0; + IPHONEOS_DEPLOYMENT_TARGET = 17.0; MTL_ENABLE_DEBUG_INFO = NO; MTL_FAST_MATH = YES; SDKROOT = iphoneos; @@ -675,7 +675,7 @@ DEVELOPMENT_TEAM = GH868RP95T; ENABLE_PREVIEWS = YES; INFOPLIST_FILE = NiceArchitectureExample/Info.plist; - IPHONEOS_DEPLOYMENT_TARGET = 15.0; + IPHONEOS_DEPLOYMENT_TARGET = 17.0; LD_RUNPATH_SEARCH_PATHS = ( "$(inherited)", "@executable_path/Frameworks", @@ -700,7 +700,7 @@ DEVELOPMENT_TEAM = GH868RP95T; ENABLE_PREVIEWS = YES; INFOPLIST_FILE = NiceArchitectureExample/Info.plist; - IPHONEOS_DEPLOYMENT_TARGET = 15.0; + IPHONEOS_DEPLOYMENT_TARGET = 17.0; LD_RUNPATH_SEARCH_PATHS = ( "$(inherited)", "@executable_path/Frameworks", diff --git a/NiceArchitectureExample/NiceArchitectureExample/UI/Coordinator/PostsCoordinator.swift b/NiceArchitectureExample/NiceArchitectureExample/UI/Coordinator/PostsCoordinator.swift index 62113e7..001832c 100644 --- a/NiceArchitectureExample/NiceArchitectureExample/UI/Coordinator/PostsCoordinator.swift +++ b/NiceArchitectureExample/NiceArchitectureExample/UI/Coordinator/PostsCoordinator.swift @@ -18,9 +18,9 @@ enum PostsRoute { /// it should be responsible for holding references to each of the viewModels it manages /// and use that information, plus any changes in state, to decide which View to present. /// ViewModels can interact with their coordinator to update the state or navigate to other pages. -class PostsCoordinator: ObservableObject, Coordinator { - @Published var viewModel: PostsViewModel! - @Published var postDetailViewModel: PostDetailViewModel? +@Observable class PostsCoordinator: Coordinator { + var viewModel: PostsViewModel! + var postDetailViewModel: PostDetailViewModel? init() { viewModel = PostsViewModel(coordinator: self) diff --git a/NiceArchitectureExample/NiceArchitectureExample/UI/Coordinator/PostsCoordinatorView.swift b/NiceArchitectureExample/NiceArchitectureExample/UI/Coordinator/PostsCoordinatorView.swift index df9da5c..4ee0b3e 100644 --- a/NiceArchitectureExample/NiceArchitectureExample/UI/Coordinator/PostsCoordinatorView.swift +++ b/NiceArchitectureExample/NiceArchitectureExample/UI/Coordinator/PostsCoordinatorView.swift @@ -14,10 +14,10 @@ import SwiftUI /// managing transitioning between Views. /// Doing so reduces the complexity of individual Views, and helps with things like navigation. struct PostsCoordinatorView: View { - @ObservedObject var coordinator: PostsCoordinator + @Bindable var coordinator: PostsCoordinator var body: some View { - NavigationView { + NavigationStack { PostsView(viewModel: coordinator.viewModel) .navigation(item: $coordinator.postDetailViewModel) { viewModel in PostDetailView(viewModel: viewModel)