|
How can a "Whats new Screen" Only be displayed after an apps launch or after a update was detected? Apple does this when bigger updates happen (or at launch) which is quite nice from a users point. I have already Created the View (WhatsNew) but i cannot manage to get it showing when app launches first time or at update, it just starts in the default "ContentView" or the "Whats new" View. My knowlege is limeted in the SceneDelegate also found a page which clears up the topic a bit for me, but I am stuck at step 3... Were should this be placed?
https://blckbirds.com/post/how-to-show-a-swiftui-onboarding-screen-only-when-to-app-launches-for-the-first-time/ Also im not sure if the message also gets displayd when the app launches after an update. Is there maby a different way which is easyer? Thanks for taking your time. Appreciate it. Pascal |
|
If you implement it as in the link you're refering to it will only show it once you started the app the first time, but not anymore after updates. To always get the "whats new" screen you need to also work with the version of the app. I would implement it the following way:
|
|
It seems as something is happening because the app Takes longer to launch. But im not sure were my mistake is, or if i have used the code correct. Tryed to follow all the Steps. I have made the AppLaunch file with the Code: Managed that it complies with the @ViewBuilder, but it doesn’t want to Work. Not sure if this is a good way or better to add to the WhatsNew View?
Added the Version in my UserData file Which i don’t know if this is needed...?
The "WhatsNew" View (which should only be visible at App updated):
And the ContentView my main View .... The App Takes longer to load. Maybe it is because it is deleted and reinstalled.... It seems as if it is trying to load something but then after 5 to 7 sec the normal ContentView launches.... It writes out nothing, just as a normal launch. Thanks in advance for taking your time. |
|
I did make a small app where i check after ContentView() has been started if the app is started for the first time. When you run the code right after the first start you will get a WhastNew screen. When you restart the app it won't appear until you change the version number of your app and start again. Hope this helps. In a production code i would move the two functions to an separate file/class for better readability of the code.
|
|
Thank you very mutch it works perfect. The way you showed is way better solved than the Initial "How to tutorial" I was trying to implement. |
|
SPONSORED Ready to dive into the world of Swift? try! Swift Tokyo is the premier iOS developer conference will be happened in April 9th-11th, where you can learn from industry experts, connect with fellow developers, and explore the latest in Swift and iOS development. Don’t miss out on this opportunity to level up your skills and be part of the Swift community!
Sponsor Hacking with Swift and reach the world's largest Swift community!
This topic has been closed due to inactivity, so you can't reply. Please create a new topic if you need to.
All interactions here are governed by our code of conduct.
Link copied to your pasteboard.