splash screen like tap tap revenge 3 - iphone

thank you for taking your time to read this message. I hope you are able to answer my question.
I would like to add a splash screen to an existing project similar to that of tap tap revenge 3.
it basically shows one screen for 2 seconds then another for 2 seconds and then it just shows the menu straight away.
Can anyone tell me how i would be able to create something like that?
thanks
.

Obviously opinions on splash screens vary. However, to do what TTR does is pretty simple; have a single Default.png file for your first screen. Then, make the top view controller you load at startup a simple image, and that's your second screen.
The trick is too offload as much of your startup code as possible, and defer it to after the initial launch. Anything done= between startup and the end of applicationDidFinishLaunching: will be done while your Default.png screen is shown. Use -performSelector:withObject:afterDelay: to defer 'expensive' calls, so that you can quickly get to your second splash screen.

its very simple. i've just accomplished this and it works exactly the same way that the tap tap revenge loading screen does.
To load 2 different screens one after another before showing the main menu you do this.
1) create a nib file place a UIButton that covers the whole screen then connect it to an outlet.
2) in the viewDidLoad method i made sure that the UIButton's image background property was set to image1 then after 1.5 seconds change it to image2 with a timer.
now the tap tap revenge loading screen allows you to skip those two loading screens by tapping on the screen. so basically create a function so that when the user taps on the screen (which essentially is a huge button that covers the width and height of the screen) it would change to UIButtons image background property to image2. If clicked again it would load a new nib file for the main menu. voila job done.
so either way if you dont tap on the screen (the uibutton) then because of the timer the application will show image1, then change the UIButton's image automatically to image2 after 1.5 seconds then again after another 1.5 seconds (3 seconds in total) the application would load the mainMenuView nib file.
obviously when you click the button once it should change to image2 but then how do you get the image to change to image2 when the same function is called:
well i have a counter which will incremement in 1 when the function is called.
so at startup that value would be 0. so when the user taps on the button to quikly skim past the loading screen the value would change to 1 and the image would change to image2.
when the user clicks on the button again to skip from image2 to the loading screen the same function would be called that changes the image but would check the counter to see if it is in value 1 and if it is then that its already on image2 so then just load the screen.
its as simple as that. it works very well.
If there is an easier way to do this do let me know. thanks
Pk

Related

How to hide window screen and show screen after a time interval in iPhone?

I have a problem that in my app i don't want to show any type of screen and when application install on device but after 2 minutes i want to show a screen. I am using following code for this
-(void)applicationDidFinishLaunching:(UIApplication *)application{
// after 30 seconds it will show a view
[self performSelector:#selector(show_view) withObject:nil afterDelay:30];
[self.window makeKeyAndVisible];
}
But when i run app on device then it show a black screen for a moment and then show a white screen. And after 30 second of white screen it add new view on current window.
But i want that when it install on device then it will start a thread in background immediately and direct show last view. Don't show any other view or screen.
How to apply that in application?
Thanks in advance...
If you looking when the application is loading that time we can't handle that moment for that you need to use the one image put that place called the splash screen.
You need to just one image which size is into iPhone is 320*460 image and give the name of the images is "Default.png". and put into resource folder.
That's better solution for that.
There is no way to achieve this. When you start an application, it is shown immediately to the user. The white screen that you see is the window, which is the first view. Even if you leave "[self.window makeKeyAndVisible]" out you will still see a black screen.
You might now think about closing down your app programmatically right after the start and automatically relaunch it 30 seconds later, but both is also not possible.

how to reload a view again and again

hi i am a new iphone programmer
i am creating a imagedisplay type application where i have to display images on a view and by presssing a next button a new image should appear on same view (i am using database)...
therefore i need to reload my current view again and again...each time when i click that button....
i tried some suggesion which are given on this website but not satisfied because many of them are based on timer...
please help.....
May be I have missed something in your question. But why you need to reload the entire view? You are using an UIImageView to display your image, right? And you are not showing any kind of scroll, but only a next button, right? Then why don't you just set the image property of UIImageView when the button is tapped.
// in button handler
myImageView.image = [UIImage imageNamed:#"new_image.png"];
Perhaps you could use a paged UIScrollView with three uIImageViews and always have the previous, current and next image loaded. This way when the user hits next, it scrolls animated to the next image. When page 3 is loaded, it programmatically sets the second image view as the desired next image, sets the image you came from on the first image view, and sets the scroll view non-animated to page two and loads the next image in the third image view.
Sounds complicated but basically you are giving the appearance of an infinite scroller but only pulling one image at a time except for initial load of three.
You could try looking at the "PageControl" Example Project in the XCode Documentation. It should give you a good starting point.

Blocking UI Interation whilst image is downloading

Im using NSThead and have a loading screen whilst im downloading images form the web to display, whist this is happening, could i stop the UI touch being registered? I have buttons on that view and when the loading screen is up, its basicllya text label which has a slightly transparent background. but if someone clicks on it, it registers the back ground buttons being clicked so i want to avoid that.
I recommend to use a UIAlertView for this.
Override the buttons and provide your own "HideIt" handler wich finally call Dismiss...
UIAlterView is somehow a UIView so you can change it's look.
And it blocks the underlying UI without any extra code.
Also possible - Create a (somehow transparent) UIView which covers your View.
You can place a text and / or a UIActivity... on it to show a loading animation.
When loading starts show this thing - when done hide id.
If you want to update this view (Progress indicator / text) be sure to run the updates on the MainThread.
Manfred

Display an image on screen after button is pressed in Cocoa

I was wondering what I should use to display an image on screen every time the user presses a button. I am using Objective-C/CocoaTouch on the iPod Touch. I would like to pull these images from an array I have set up and place them on the screen when the button is triggered. I feel dumb asking but any one that can point me in the right direction would be great. I think I could figure out the rest from there.
Thanks.
I'm sure there are many ways of doing this, but one way would be to define a UIImageView on the screen, and make it hidden. When the user presses the button, you can set the source of the UIImageView to the image from your array, and set the hidden property to NO.
I think it's as simple as something like this:
[myImageView setImage:[imageArray objectAtIndex:theIndex]];
In your button's action method. You can set theIndex before or afterwards to get a different image from your array every time the action method gets called.

Why my iPhone app has a delayed loading?

I noticed some iPhone apps give you the title screen instantly.
Then there are some apps that gives you a black/blank screen for a brief moment.
I have the latter issue, but its lasting about 2 seconds.
I would like to display a PNG image (over 200 KB size) and a loading indicator view.
My app is based on UIView. The specified a custom UIView that basically loads and renders the said image as the wallpaper.
I tried not loading this image, yet im still getting a 2 second delay time to load.
The app delegate basically sets the view controller's view as a subview.
This delay is only seen on the device, not on the simulator.
What am i over-seeing?
If you place a Default.png file in your mainbundle, it gets displayed at launch time between the time that the app is tapped on till the time that you replace it with another view.
The reason you don't see it in the simulator is because it is faster at loading your app.
If you want to display a progress indicator, you will only be able to do it once the appDidFinishLaunching is called, but the delay that you are seeing is still there.
One trick I use is to have the same Default.png displayed again in appDidFinishLaunching and then draw a progress bar on top of that. Sure there is still the static display during the initial delay, but from there until all my initial views are loaded, I display a progress bar.
There have been some recent discussions about this on StackOverflow that you should see. And see this: How To Make Your iPhone App Launch Faster