how to animate launch image once app has finished launching - iphone

I was wondering how I can manipulate the launch image of an iPhone app? I have put launchImage.png into my plist file (under Launch image (iPhone)) and when the app starts I would like to animate this launch image out of the view, like so:
launchImage.transform = CGAffineTransformMakeTranslation(-CGRectGetWidth(launchImage.frame), 0);
But how do I access an image which I've defined in my plist?
Or will I simply load another instance of the image and then animate it out of the way? This appears a little cumbersome, especially as the app has already loaded the launch image.
Any suggestions would be very much appreciated! Thanks in advance!

You'll have to load another instance. You can't access the launch image from your app. I usually just make a UIImage that matches the launch image and in my viewDidAppear method I animate it away with a performSelector:withDelay: of a second or 2.

Your best bet is to create a UIImageView instance set to display your launch image, put it on the root view controller's view, then animate it out of the way as you've described (perhaps in -viewDidAppear:). As far as I know, there's no API mechanism for interacting with the launch image directly.

You have to load up the launch image again and then animate it out.

Related

Retrieve data from API while launch image is shown

Is it possible to retrieve data from web service while launch image is being shown?
Or I will not show a launch image but I'll just use a view controller with an image (launch image), and retrieve data when that view controller is currently viewed?
You don't really have any control over the launch image, so the second option you listed is how you should do it.
Apple's Human Interface Guidelines suggests to "Start Instantly", not to use a launch image, but instead to show the actual interface as soon as possible, and if it's not ready yet, to show an activity indicator, etc.
The launch image is there simply because you application's delegate and main view controller are NOT yet loaded into memory. Par Apple documentation: launch images are there to look like the first view controller to give the perception that your application starts faster than it is truly is.
What this all means is that while the launch image is shown, you aren't getting anything but setup code done. The closet you could get loading something from the web on start up would be a "viewWillLoad" or "xxxWillLoad" type method. Loading an extra view controller is a waste of the user's time and (although considerably small) memory.

Good ways to dynamically generate the start image of an iPhone/iPad app

I'm self-learning iPhone development and I see that one of the aspects of an iPhone/iPad app is the start image that gets displayed when your app is run. I'd like my start image to display some basic info about the user when the app is launched, but that info has to first be collected by the user when the app is first run. That tells me that I either need to dynamically generate the start image after the user enters their information or I need to place a label of some sort on top of my static start image in order to accomplish this. The first time the app launched and before the user enters their info, the start image can be anything or nothing at all, I'm not concerned about this.
So, my questions are...
Can you place controls, like a label, on top of the start image when your app is launched?
If not, what's a good approach to dynamically generating the start image after the app is launched for the first time and the user info is collected?
If there's no way to change this start image (thanks kristopher!), can I instead display my dynamically generated image for a set amount of time (~3 seconds) as soon as the start image closes? Do I even have to use a start image at all?
Thanks so much in advance for your help! I'm going to begin researching this question right now.
To answer number 3, Yes, you need a start image. It should look like your dynamic start image but without the dynamic information.
To display the dynamic information briefly after launch, just use a modal view controller on top of whatever view controller comes up first (called viewController below):
SplashScreenController *splashScreen = [[SplashScreenController alloc] initWithNibName:#"SplashScreenController" bundle:nil];
[viewController presentModalViewController splashScreenController animated:NO];
[splashScreenController release];
[viewController performSelector:#selector(dismissModalViewControllerAnimated:) withObject:YES afterDelay:3];
Obviously you need to create a UIViewController subclass and xib file called SplashScreenController.
Apps can't change their start images. Those image files, as well as other files in the app's bundle, are treated as read-only by the OS.
If you don't have a startup image, then the user will just see a black screen for a second or two (or more, depending on how big your app is). It's a good idea to have a startup image.
You can display whatever you want after your app starts running.
I do something similar to what you are trying to accomplish, except I do not display user information. If you want to see what I did, check out my app How Long Can You Tap It (free). The Very first image, as Kristopher mentioned, is not changeable. It will be displayed for as long as the application takes to load. Then, the image will disappear and show your initial viewController, which will be whatever you want. In my app, it simply is the same image is the initial image, but instead of saying LOADING I display text telling you to Tap the screen to start playing. If you don't want to rely on the user to tap the screen to continue, you can do what Frank said and dismiss it within X number of seconds. If you want more code than what Frank provided, let us know.

Freeze or pause iPhone camera image

On iPhone's built-in Camera application (OS 3.1), touching the shutter button shows an iris animation, then displays the image that was taken for a second or so before animating it away.
Is anyone aware of a simple way to get this "brief pause" activity? Or do I have to resort to manually adding the image as part of my custom cameraOverlayView?
Bonus points for the iris animation too (without interfering with said custom overlay).
Ultimately, I ended up using UIGetScreenImage() (which is now officially blessed for use by Apple) and pushing that image to a previously hidden UIImageView.
Meh.
did you try releasing the ImagePickerController after your code be done?

Default.png won't display, iPhone

I have a really standard splash screen, just a simple Default.png, but for whatever reason, no matter what I try, it simply will not load. Is there any way to fix this and/or a way to set a property in tw info.plist to directly call a custom image? Thank you!
Make sure your image is 480x320 pixels, and placed in your application at the top level. The frameworks will display this image until your initial view has loaded and is ready for display.
If you are seeing a black background then there is something amiss, however if you are just seeing your app's initial view then be happy you have managed to launch your app and have it ready for use in good time.
If you really, really want the user to to see your splash screen then slow down your launch by adding a delay into your app before you present the initial view
It is very important to name the file "Default.png" and not "default.png". Capital letter at the front. Make sure you rename the actual filename and not just the image name in XCode.
if you use Images.xcassets to manage you images,make sure the "2x" of "iPhone portrait iOS7" exit and be set as 640 × 1136.It's really useful if you are seeing a black background instead of the image named Defualt.png.
It was a simple case problem mixed with a refresh problem. Setting the case correctly and "CLEAN" the solution fixed the problem.

iPhone Animated Loading Screen

Is there a way to have an animated loading screen for my iPhone application as opposed to the Default.png that I currently am using?
In short - no. The purpose of the Default.png is to give the iPhone OS something to display to the user while it loads your application in. The best you can do is to speed up the initial load of your application (say defer your resource loading until after the program is running), then add your own animation while you actually load your resources 'behind the scenes'.
If you think of it as an animated loading screen then no, but having the first view of you application load all the data and do something while it is doing that then surely yes, but I am trying to do that and am failing at the moment
As far as I know, unfortunately not. The point of the lightness of default.png is to allow the app to do intensive ramp-up behind the scenes. Animation would eat precious CPU cycles.
However, if you need to do more processing once your app has launched - you could do a threaded CAnimation during this time.
no, but if your initialization take lengthy time.
you can add an customized animating launching view once the application is launched.
for short.
after launched, before all the real initialization, alloc, init and display a view which is exactly the same as default.png but with animating effect.
while that animating view is displaying, init the real stuffs of your application in background
replace the animating view while done
You can do what one of the app which I know does. They have created series of images, which when displayed in sequence will make one believe that the splash screen is animating. You can check this app to get an idea: TravellerID
Hope this helps.