I am having an app in which I have a requirement of changing the splash screen every time when the app launches.
I am having 5 images and i want to change my splash screen by one of the 5 images every time user launches the app.
Is it possible to do this?
You can't change the splash-screen that shows while your app is loading (that scales up when your app is launched), but you can make it something generic (like a texture or solid colour) then as the first view controller in the app you can load the exact same image (or just use a solid background colour), then you can fade-in one of your five images and show that for a short period before transitioning to the first (real) screen of your app.
For example:
Splash is solid black.
Root view controller gets set to a view with solid black background colour and an image-view containing one of the five images, with alpha set to 0.
Fade in the selected image.
Transition to first-screen of app.
By making the first view controller look exactly like the splash screen (initially) the cut-transition is seamless and your custom transition to your in-app splash screen can begin.
i suggest to leave the splashscreen empty and directly go to another view where you do all the loading and change images there. Changing the splashscreen image at runtime is not possible.
Maybe you can make an image like loading or your logo for the splash screen as this will still pop up for a few seconds.
It's not possible to do what you want. See App Launch (Default) Images. You can only change the Default image based on:
Orientation
Pixel density (retina/non-retina)
Device (iphone/ipad)
URL scheme used to launch the app
Your app data is also read-only so you can't get around this by modifying the Default.png file manually.
Also, it's a very bad idea to not add a Default.png file like some other answers are recommending. You will end up with a black screen for a few seconds, which will also appear in the multitasking switcher if your app has been terminated in the background. This is a very bad user experience and your app will look shoddy.
There is work around for this.
Don't load default Splash Screens.
You can create your own splash screen which will be called every time user open the app.
You can manage the 5 images in this very easily as control will be in your hand.
Related
I have to display a splash screen which resides on a server. Using a web service, I have to get it displayed in my SplashScreenViewController. So it's obvious that when my app launches, it will display a blank screen (img is being downloaded) and after a few seconds, it will show my splash screen.
I know that the splash screen image should have to be in the main bundle, and locally it should be seen as a splash image. But the client wants us to get it loaded from a server.
So can I use an activity indicator in that duration until my splash screen gets loaded?
That is a very bad implementation of a splash screen, but there are no other ways, you will need to use an indicator view, until the image has been downloaded,
Also consider to add a default image its much better than a white view
You will have to deal with some issues, like what would you do if internet connection is very slow or you are not connected, and what would you do if you dont recieve the image you asked for any reason
This question is similar to this one. My iPhone app allows the user to select the background image to use for the main screen. Therefore, depending on the background image selected by the user, the Launch Image screenshot (of the main screen) will likely display the wrong background image. When the main screen is finally loaded and the Launch Image is removed, it will be quite ugly for the background image to change suddenly to what the user has selected.
Does anyone have any suggestions on how to deal with this? Should I use some kind of splash screen (I thought I read in Apple's HIG that this was not allowed)? Or maybe I should somehow "transition" the user's selected background image into the view after the Launch Image is dismissed and the main screen is visible. Any thoughts?
If you really want to show a 'Splash' Image what you could do is forget about dynamically changing Default.png and use a simulated splash screen effect (simply a UIView or UIImageView covering the entire screen) which disappears after a number of seconds. What you need to ensure is you do the minimal amount of work to show the simulated splash screen and get it on the screen as fast as possible and then do any other computations later on whilst your image is shown.
There is no way you could change the actual Default.png without having the risk of your app being rejected by Apple.
Depending on how long your application takes to launch, you can use a black image as default.png. A "splash screen" isn't recommended but if there is no generic image possible and your app takes a significant amount of time to launch, it would be a better approach for the user's perspective as they would at least know that the application is launching.
Also remember that default.png is only shown when your app first launches, not when it resumes from multitasking (unless it has since been killed off).
See also this question Changing UIView when applicationWillEnterForeground fires which will be the next issue you face if your background image is set in preferences rather than within the app!
I have the universal application both for iPhone and iPad. I need to have the splash screen for the iPhone application but no launch image for the iPad version.
If I remove the iPad's splash screen image then it loads the iPhone one. I tried to set iPad's launch image key to empty string in application.plist manually but it leads to an ugly random image.
When developing a universal application, can one have the splash screen for the iPhone version but no splash for the iPad? If yes - how?
Why would you want to remove the splash screen? Only thing I can think of is to create a black image and use that as the splash screen to mimic the default black one.
You can create your splash screen and then can set the time to remove the splash screen or once the user tap on.
There are many tutorials around to create splash screen programmatically. Just use that and set the timer to remove the splash screen.
But there is the tricky solution for that as well, just take the screen shot of your home page and use as splash image and set the timer, so when the user click on any component he/she would not feel that the splash image was loading actually.
ok. I know how to display the splash screen on iPhone. Seems quite simple enough (i.e. setting the Default.png and calling "sleep" command).
But, is the application actually doing anything during this time? My app needs to go and fetch some data from Web before showing the app's first screen, but when I do the splash screen, it doesn't seem like it's doing this while showing the splash image.
Can I actaully make the app do something while showing the splash screen?
The best way would be to structure you application differently slightly differently.
Make your application display the Default.png when it starts it (ie. put a UIImageView onto screen), then start fetching your data.
Then either when you have fetched the data (or if you really must, once an NSTimer has expired, but it's a better user experience if you avoid a fixed time interval) change the view to be your real one.
Where you have got the idea that you need to call "sleep" while showing Default.png and there is nothing going on while this image is shown? Default.png is shown when OS is loading your app. You can not do anything during this time. In fact you have not got any control yet. It is handled by the OS. The idea behind this is to give user a feeling that app has loaded quickly, but actually your app is not completely loaded while Default.png is showing instead of a black screen by the OS.
You can manually add a view looking like your splashscreen after starting your app and handle the work in background. I would also add a hint to the user which indicates "loading data", because an app should start within 3 seconds.
If you read the Human Interface Guidlines, they're pretty clear that Default.png isn't intended to be a branding splash screen. It's meant to bring up a static "shell" of the initial page of UI so that the user experiences quick loading. So it's not at all designed or intended for what a lot of apps are using it for (including some of mine).
If you have your first screen that comes up be that image again, maybe with an activity spinner or status text on it, you can do whatever you need to do in the background of it, and then replace it with the first "real" screen of your app when you're done.
Generally all of the awakeFromNib calls in view controllers are done while the app is loading (ie has the splash screen up). When I put breakpoints in my apps at awakeFromNib calls, the breakpoints are hit when the splashscreen is up and the app is loading. So everything you do in
those calls will be processed while the loading screen is up.
Is it possible to make the iphone app splash screen pick up a random image or text? So that it is different every time (e.g. display tips)? If so how?
This is not possible. The Default.png file in your application is always the "splash screen". To try and alter it after the application has been built would alter the signature of your application, and it would not launch the next time it was run. (Assuming you can write to files within your application bundle, which I have not tried.)
It is true that you cannot alter the splash screen, but you can present a view with whatever you want in it. Don't include a Default.png image in the bundle. Then in your app delegate, instantiate a view controller and add it's view as a subview to self.window. Then you need to dismiss this view, either based on a timer, or the completion of your startup processing, or a user tap, etc.
It is worth noting that Apple discourages using a splash screen, and recommends that you just get the UI up and working as fast as possible. If you must have a splash screen, you can display something that looks like your working app to create the illusion of a responsive UI, and remove that as soon as your UI really is responding.