swiftui: use StateObject instead of EnvironmentObject
This commit is contained in:
parent
c67fde32e7
commit
d73a7ccd95
3 changed files with 5 additions and 2 deletions
|
@ -26,7 +26,8 @@ android {
|
|||
|
||||
buildTypes {
|
||||
getByName("release") {
|
||||
isMinifyEnabled = false
|
||||
isMinifyEnabled = true
|
||||
isShrinkResources = true
|
||||
proguardFiles(getDefaultProguardFile("proguard-android-optimize.txt"), "proguard-rules.pro")
|
||||
}
|
||||
}
|
||||
|
|
|
@ -363,6 +363,7 @@
|
|||
DEVELOPMENT_ASSET_PATHS = "\"PeopleInSpaceSwiftUI/Preview Content\"";
|
||||
ENABLE_PREVIEWS = YES;
|
||||
INFOPLIST_FILE = PeopleInSpaceSwiftUI/Info.plist;
|
||||
IPHONEOS_DEPLOYMENT_TARGET = 14.0;
|
||||
LD_RUNPATH_SEARCH_PATHS = (
|
||||
"$(inherited)",
|
||||
"@executable_path/Frameworks",
|
||||
|
@ -383,6 +384,7 @@
|
|||
DEVELOPMENT_ASSET_PATHS = "\"PeopleInSpaceSwiftUI/Preview Content\"";
|
||||
ENABLE_PREVIEWS = YES;
|
||||
INFOPLIST_FILE = PeopleInSpaceSwiftUI/Info.plist;
|
||||
IPHONEOS_DEPLOYMENT_TARGET = 14.0;
|
||||
LD_RUNPATH_SEARCH_PATHS = (
|
||||
"$(inherited)",
|
||||
"@executable_path/Frameworks",
|
||||
|
|
|
@ -3,7 +3,7 @@ import common
|
|||
|
||||
|
||||
struct ContentView: View {
|
||||
@ObservedObject var peopleInSpaceViewModel = PeopleInSpaceViewModel(repository: PeopleInSpaceRepository())
|
||||
@StateObject var peopleInSpaceViewModel = PeopleInSpaceViewModel(repository: PeopleInSpaceRepository())
|
||||
|
||||
var body: some View {
|
||||
NavigationView {
|
||||
|
|
Loading…
Reference in a new issue