Skip to content

Commit bc62e91

Browse files
authored
onAppear
1 parent 93c3233 commit bc62e91

File tree

1 file changed

+6
-4
lines changed

1 file changed

+6
-4
lines changed

TipsGotTrolled/TipsGotTrolledApp.swift

Lines changed: 6 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -12,11 +12,13 @@ struct TipsGotTrolledApp: App {
1212
@AppStorage("isFirstLaunch") var isFirstLaunch: Bool = true
1313
var body: some Scene {
1414
WindowGroup {
15-
if isFirstLaunch {
16-
UIApplication.shared.alert(title: "Please delete Tips app then (re)install it before proceeding", body: "Hi ! It looks like it's the first time you come here. To avoid any corruption, please delete Tips app from Home Screen then reinstall it. Thanks for using this tool!", withButton: true)
17-
isFirstLaunch = false
18-
}
1915
ContentView()
16+
.onAppear {
17+
if isFirstLaunch = true {
18+
UIApplication.shared.alert(title: "Please delete Tips app then (re)install it before proceeding", body: "Hi ! It looks like it's the first time you come here. To avoid any corruption, please delete Tips app from Home Screen then reinstall it. Thanks for using this tool!", withButton: true)
19+
isFirstLaunch = false
20+
}
21+
}
2022
}
2123
}
2224
}

0 commit comments

Comments
 (0)