Can the startup/splash screen be changed depending upon the state of the application upon startup? - ios

My app has a registration screen that is only presented once, and after registration is completed it is never shown again.
If my startup screen is a screenshot of the app then I would need to provide two screenshots and for the correct one to be initially displayed when the app launches.
Is this possible?

No, it is not currently possible. You cannot access the Default.png (or whatever you've named it instead) from your app to update it.
If it were me, I would set the startup screen to the one that is appropriate long term. You could also theoretically update your registration screen to be a bit closer to the look and feel of the main app screen, so it isn't so far off visually.

Related

How to take a screenshot programmatically if the app is running in background

I am writing a piece of code using swift for iOS.
It’s using location services. I need to take a screenshot of the current screen every time the location gets updated.
The thing is when the app is running in background and updating the location the screenshots taken are from my app. Not the app which is currently available in the screen.
Assume that the user plays a game in their phone. But my app run in background and updating the location when the users location is significantly changed the screenshot should be taken and it should include the game. Not my app screen.
Can some one tell me how to achieve the screenshot capability I want.
Short answer: You can't.
Apps can only take screenshots of their own content. Starting with (I think) iOS 7 Apple blocked the ability of apps to take screenshots of anything but their own content. This is for security reasons.
Imagine your app echoes each character of your password as you type it, and then replaces it with a bullet as you type the next character. Now imagine an app that runs in the background and takes a screen-shot every time your app displays a new character of the user's password.

How to call Screen Time at settings from my app

Apps set to Screen time are strongly constrained by their behavior.
If the screen time starts while the app is running, the nature of the app causes problems in operation.
Normally, the setting screen is called by the following code, but I do not know how to call Screen Time.
UIApplication.sharedApplication().openURL(settingsURL)
Do you know how to do that? Or tell me if there is another way around it.

Launch screen for iOS

I have read a few posts on this topic about making the launch screen last longer, but I want to make it shorter.
Currently my launch screen takes 4 seconds before loading the login screen, and the app is not even close to being finished yet. Does that mean the launch screen could take longer to load once the app is finished?
Is there any way to make the launch screen appear for 2 seconds?
Xcode, Swift. backend in PHP.
The launch screen loading time depends on how "long" it takes your initial view controller to be prepared.
So, if you want it to "load faster" make your initial view controller more lightweight, do this by:
Reducing the number of interface elements being shown
Do not perform that many operations inside the "view did load" method.
Other than this, theres really not much you can do to control the time.
There isn't really a straightforward way of making the launch screen last shorter, because it depends on how long it takes for the necessities of your app to load.
Remember, the shorter the launch screen, the better, so the users of your app won't think that your app is taking a lot of time to boot up.

Start app and navigate to the view previously displayed

I have an app (iOS, Swift) which is usually started in the morning by the user. The user will press a couple of buttons, enter some text, move to other views (using a navigation controller) and so on. When everything is filled out the right way, the user will put the iPhone into standby mode. As far as the app life cycle is concerned, it will enter the background state. When the user opens the app again, he will still be on the same page, with the same parameter, ... Everything is fine.
In case of a suspended app (due to a lack of resources or other stuff), the app will start again from the beginning and not from the view where the user has navigated to before. In such a case, what's the best way to navigate to the specific view the user was when bringing the phone into the standby mode and keep respectively build up the whole navigation stack as it was before the suspension?
You can use Apple state restoration and preservation technique for this purpose. Here you can find an example provided by Apple.
Hope this will help.

iOS remove view before applicationWillEnterForeground

I'm developing an app on iOS 7 with a desired feature is that
When I home button, app enter background, I will add an image to current UIWindow. So when app enter background, if user double home button on iOS 7, os will show a small screenshot of current view of my app, so user can see my added image. :) (I did it)
When user return my app by clicking app icon, I want to remove this image immediately. In this situation, "immediately" means that user can NOT see this image anymore, user just see his/her current view when app enter foreground. I try to place the code remove image on the beginning of applicationWillEnterForeground delegate, but I'm still able to see this image for a short time after it disappears.
I also try to set hidden, alpha property for this imageview first, then removeFromSuperview, but it not works.
Can anyone help me to remove it "immediately" as my desire.
That is done automatically for all applications, you don't need to do anything in you code.
I don't think that you can do it faster, it depends of device performance. Sorry man.
Like other says it is really tricky how iOS handles these events. I've been researching and depends on the memory state of the device to do it faster or not. Indeed, in iPhone 4 and 4S may not show the image that you added on applicationWillEnterForeground method.
If I were you I would solve it by adding a smooth fade out animation of that image when the app becomes active again. With [UIView animateWithDuration: animations:] it could be nicely done! :)
If I find out something else I'll answer here!

Resources