How to make my LaunchImage load at the same time as the application? - ios

As the application loads, I want to make an image load at the same time, for example, a line would elongate form either side as the application loads, and when it has finished, the line would have reached its maximum length. I have seen this in a few websites, like rime arodaky for example, but I want to this for an iOS application. I have searched on Google but couldn't find anything!
Does anyone know how to do this?

The launch process if we REALY simplify it to accommodate your question, can be split into two parts.
The first part you do not have any control over, and during which a launch image is shown.and it ends with a delegate call-back on the application delegate called
applicationDidFinishLaunchingWithOptions
The second part is you might have some application specific behaviour which requires no activity from the user but you app still isn't interactive.
You need to implement such a progress bar yourself. There is no built in support for this in any of the app templates in Xcode.
You can only do what you want during this second phase. But you have absolutely no control over the first phase, except for that static non-animated launch image.

I think you can just add a photo as a launch image, launch image is just an image.Then you can add the animation when your first view controller appears.You can fake it this way.

Related

How I can make a dynamic splash through WS in swift - iOS?

I need to download and show an image on the Splash of my application. But I don't know if this is possible or a good practice on the splash, even I wanna know if there's a workaround to make this.
Thanks.
LaunchScreen.storyboard (or Xib) is tremendously limited in functionality compared to a regular storyboard. You won't be able to do much on it.
The only possible way is to have a SplashViewController or the name you prefer as first Window's rootViewController. (can be defined in AppDelegate's application(_, didFinishLaunchingWithOptions) or Main interface in General tab of the Application target.
The initial layout of that first SplashViewController should be exactly as your LaunchScreen, trying to avoid a visual jump between them. After that you're free to show whatever you want.
Obviously, if you are going to do network load or any other type of task that delays the launch, it is convenient to show the user something that indicates this work. As far as possible cache so that in future launch the start is as fast and smooth as possible.

iPhone SDK - possible to have multiple splash screens?

I'm making an app with a different screen for its first run. Once it has completed its first run, this screen is never shown again. The issue I have is that my launch image is built to look like the view that the user sees every other time they run the app, so at first run the loading screen looks weird. Is there any way to have one loading screen for first run and one loading screen for other runs? Thanks
You cannot have multiple or dynamic launch images. Even with the new storyboard/nib launch files, they are still quite static.
Make sure to open an enhancement report with Apple, requesting this feature.
In the meantime, consider a slight change of your flow to first display the initial view, and have an animation to display your first-launch view. This way, the transition will be smoother and more natural to your users.

Screenshot that taken by iOS when (before) application go into background?

I hope that you all know about it, iOS takes screenshot before your application goes to background.
I got it from official document.
Remove sensitive information from views before moving to the background: When an app transitions to the background, the system takes a snapshot of the app’s main window, which it then presents briefly when transitioning your app back to the foreground. Before returning from your applicationDidEnterBackground: method, you should hide or obscure passwords and other sensitive personal information that might be captured as part of the snapshot.
So, Here We can hide our "sensitive personal information" and the system takes a snapshot of the app’s main window, so we can not change its feature.
But I want to know..
1) If in my application I'm at 4th View, and my app goes to background then system takes screen shot of which view/page? first one (start up view of apps?) or 4th view/page of the app ?? (here is little confusion for me).
2) Can we fire any action when system is taking screenshot or any notification is available that will inform us of system taking screenshot ??
3) I just want to know, is it possible to take screen shot (programmatically) before my application launch ?? If YES then give me suggestion for how to do it. And if NO then where/when I'm able to take screenshot (I mean at which minimum stage of application we'll be able to take screenshot ?) ?
It will take a screen short of the top most view, actually it is taking a screen shot of the window which is displaying your app.
No there is no notification that the screen shot is going to or being taken. You should just handle the handle it in the applicationDidEnterBackground; method. Just a stated in the documentation
No this is not possible, how do you want to execute any code before you app is running? The OS will make the screen shot, just be sure to have everything hidden in the applicationDidEnterBackground;. The minimum state is that your app is up and running.
What I've done is on of my apps is as soon as my app gets pushed to the background place an extra view on my UIWindow. Thus when the screen shot is made this view is captured.
1) There is just one screen. The screenshot is taken of that screen. In your model case that should be the 4th view controller's view. However, it is quite possible that your 4th controller's view does not cover all of the screen or has transparent elements. In that case parts of the 3rd or even 2nd and 1st view controller's view are part of the screen.
It is a screenshot not a view controller shot or anything.
2) You understood the documentation all right. The screenshot is taken after you returned from applicationDidEnterBackground. There will be no further dokumentation.
3) No, you cannot execute any code before your app is invoked. However, I have the feeling that you are looking for something different than you asked literally.
For some other reason I have executed a small program in the simulator by implementing the main function only even without calling UIApplicatoinMain. This is the first point in time where code from your app may be executed, although that would not be exactly "out of the book". If I remember right, the screen was blank/black at that point in time. So if you are asking for a way of creating screenshots of other apps, this is not the way to go forward.
It is not taking a screenshot quite like a user pressing buttons.
This functionality is related to state restoration. When the application goes to the background it flattens the view hierarchy for each screen into a screenshot used for the task manager. If you are opted into state restoration it will also persist the state of the user interface. This means that a person can bring the application back from the background state and potentially see sensitive information that way as well, which may be something you need to handle.
Preventing information from being included in the state screenshot is covered in Tech QA 1838.
1) I'm pretty sure the system will take the snapshot of the current visible view, so the last one on the stack, not the first one
2) Also, there will probably be a Notification to let us know that the system is going to take a screenshot (otherwise how can we hide sensible information? :) ), but I'm afraid we're currently under NDA I guess?
3) What do you mean "take screenshot before my application launch"? Your code starts executing when your application launches, so this question almost makes no sense :-/
You can anywhere in your application take a snapshot of the screen, however, and there are many stackoverflow posts for that

Show splash screen only once IOS

I understand, Its a HIG violation to play around with the default launch icons and splash screens, but I have requirement such that, I need to display the splash screen only for the first time, Is it possible to implement it ?
One simple solution, I can think of is : displaying as an imageView on top of UIwindow and then removing it based on a timer. Am looking for other options.
My advice is to rework your view hierarchy so that the first view mimics the splash screen you wish to show (A view controller with a uiimage embedded should work fine for what you've described). Then push the "main screen" over top of that view after your specific period of time. A little code to ensure that this happens only on the first run with some persistent storage and you should be good to go.
I do not advise working with UIWindow directly. Doing so can lead to all sorts of headaches.
That is to simple.
But you aren't need to manipulate the launch image, but an image loaded by your app.
To prevent to launch the second time you can set a flag in the internal storage.
Make sure to use a lazy load / initalization technique and display the image fast as much is possible, than do the initializations.
I hope it helps!
If you use iOS6, you can use restoration feature.
At first run your app will show launch image. All other runs it'll show last state screenshot.
So you know its a HIG violation but looking for some workaround.
You have to have a launch image while uploading the app and showing on first launch.
I assume you dont care about app review in appstore.
Lets think
Launch image has to be in main bundle. And the main bundle is readonly for your code.
I have some workaround but it may work only for second time launch to show the launch image and then no again.
Add your launch image with any name
Add a symlink to your app bundle with name Default.png, which shows the file in 3. step
Copy that launch image to your app directory folder (your symlink in app bundle shows the file) on first launch.
Launch second time the app and see the launch image
Delete the copied image.
When your app can not find a png file which showed by your symlink it can not show launch image
PS: Personally I did not try that but may work.

What is the purpose of launch images in an iOS application?

How important is it to add Launch Images to an iOS application? I assume that these are like a cached file to show on the screen while the application is getting setup, when there might otherwise be nothing to show until it is fully running. Is this right?
If so, what should a launch image be if your app might start in different states, or does this not effect return to foreground when multitasking? If it is only for the very first initial launch of the app, then the launch image should just be the same as whatever graphic normally appears when you first start the app, right?
Apple must not care too much about whether your app actually includes these, since mine never have.
Note: as Zev mentions below, the Apple HIG recommendation has changed since I originally answered this question. Apple now recommends that you take all of the static elements of your first screen and make that into your default or launch page. All dynamic elements are to be removed, to give the impression that your app is going through an initialization process -- which in some cases may mean that your default screen is simply a background from your app. Thanks to Zev Eisenberg for pointing that out, "splash" pages are not recommended.
The launch image will show while your app is initializing, it's a good idea to have one. If you don't have one the user is likely to stare at a blank screen while waiting for your app to load. I believe the recommendation is to use an image that looks like the first page of your app. Here is the reference:
http://developer.apple.com/library/ios/#documentation/UserExperience/Conceptual/MobileHIG/IconsImages/IconsImages.html#//apple_ref/doc/uid/TP40006556-CH14-SW5
how about if app is starting immediately and no time passed ?
what if you see (or cannot see) for a 0.1 sec launch image ?
would it be still useful to have two images in main bundle that will never be seen or used ?

Resources