Writing code logic for launch screen

I want to make an app which has below flow.

If user is not logged in (Opening app for first time)
–then… show launch screen…and then show login page.

If user is already logged in (After successful login going to home page… killing the app and launching it again)
–then… show launch screen…and in behind hit JSON API to validate the user.
–if user is valid then show home page… else show login page.

So now my question is how can I code the launch screen to hit JSON API or what will be the better way to achieve this flow ??

Hi @sandeepry92

Xcode doe snot allow us to write any code for the launch screen. You can have static images, etc. but no logic.

What you can do is a check a userSetting for a first launch Bool and if true show your onboarding screens or whatever. If false then show your login screen, grab JSON, etc.