IOS Splash screen/popup display from closed library - ios

We own proprietary library built for IOS, used by our customers in their application. Basically the library has no UI related functionality, but When they call our library init api, we want to add a splash screen or a popup(containing our company logo) to be displayed on top of their UI.
This splash screen might be called anytime, during or after the application launch time.
Also it is possible that proprietary library init API may not be called from main thread.
Would like to know if there is a reliable/feasible solution with some direction/examples?
Thanks,
Hari

Create UIImageView and add image and then
[self.window addSubview:uiimageview];
[self performSelector:#selector(dismissPopover) withObject:nil afterDelay:3];
and then remove the image
-(void)dismissPopover
{
[popover removeFromSuperview];
}
check this iPhone app: avoiding white screen after splash screen. Let splash screen linger, hide it after UIWebview loads? Splash screen not hiding properly

Related

AdMob using in splash screen

Bview=[[ADBannerView alloc]initWithFrame:CGRectMake(0, 0,320, 100)];
[Bview setBackgroundColor:[UIColor redColor]];
[self.view addSubview:Bview];
The Above code i used for displaying iAds.
Is this possible to adding AdMob or iAds or any other advertisement portions can able to adding / inserting of splash / launch screen using Xcode 6.0.
You can use splash screen as a rootview controller.
Add background image of splash screen on that view controller.That means your view controller will act as splash screen. Here you can add your code for admob.Otherwise it is not possible.
One more thing, if ad takes much time to display on splash screen, apple can reject your app.
Reference from apple document-
"As much as possible, avoid displaying a splash screen or other startup experience. It’s best when users can begin using your app immediately."

How do I run code while my app is starting up underneath the splash screen? [duplicate]

This question already has answers here:
App Loading and Splash Screen
(4 answers)
Closed 8 years ago.
I'm trying to be able to run code in the background while my iOS app is starting up. I have to call a few APIs which may take a few seconds to get information for the first page of the app, and I want to make it look seamless, so I want all that API loading to take place while the splash screen is open.
How can I accomplish this?
Thank you!
If you set up the launchImage in the project general properties, then whatever you have in the appDelegate didFinishLaunchingWithOptions method, before you call the main viewController will be done in the "background" while the launchImage or splashScreen is seen.
Another thing you can do, is make the appDelegate load an initial viewController that just has a UIImageView that takes up the whole screen, or just a background image for the main UIView. In this view controller you can make any calculations you want, and save the data you need, and when all of that is complete, you can then load the main view controller you intended to load.
A small pseudo code for this could be like this:
dispatch_async(dispatch_get_global_queue(DISPATCH_QUEUE_PRIORITY_HIGH, 0), ^{
//do calculations
dispatch_sync(dispatch_get_main_queue(), ^{
//load main view controller
});
});

applicationWillResignActive called by iOS alerts too. How to avoid this?

I use applicationWillResignActive to display the splash image when my app is in background (see code-snippet). Reason: I don't want private data of the app be visible when my app is in background on iOS 7 and the user presses the Home button twice.
splashWindow = [[UIWindow alloc] initWithFrame:[UIScreen mainScreen].bounds];
splashWindow.windowLevel = UIWindowLevelAlert;
[splashWindow addSubview:splashViewController.view];
[splashWindow makeKeyAndVisible];
The problem is that applicationWillResignActive is also fired when iOS shows an alert because some certificate is about to expire. How can I fix this? Do I need to take another approach to display the splash image in background?
Thanks for any advice
You could also use the applicationWillEnterBackground to open a blank screen/your splash image and switch back to your normal screen with applicationWillEnterForeground.
Fixed: I could not change the iOS behaviour as described but I used:
[self.window addSubview:splashViewController.view];
instead of the code-snippet above. The iOS alert still makes the splash appear but I hide it again in applicationDidBecomeActive with [splashViewController.view removeFromSuperview];
The splash now disappears when the alert is answered with OK or Cancel.

how can i make a custom, in-app camera for my iphone app developed in xcode?

i am making a photography iphone app and am after, upon the app being launched, the screen to be a large image where the camera is shown in the center through a hole in the picture - this should be a similar look to that of hipstamatic. since the camera would be open upon launch, i would also need a button to take the picture (but that is not a priority at the moment). i am wondering whether there is an easy way to do what i have described? so far, research has pointed me towards using the uiimagepickercontroller, but using just this did not give me nearly the amount of customization i am after - or am i mistaken and i can do as i described using the uiimagepickercontroller?
right now, this is the code i'm using for the camera - it's currently an ibaction linked to a button that launches the camera once clicked. however, as i mentioned, i would like the camera to open on its own upon opening the app
self.picker = [[UIImagePickerController alloc] init];
self.picker.allowsEditing = NO;
[self.picker setSourceType:UIImagePickerControllerSourceTypeCamera];
[self presentModalViewController:self.picker animated:NO];
[picker release];
this code not only navigates away from the current view, but it has all the controls (zoom, tap to focus, etc.), is full screen, and plays that silly animation of the lens opening.
anything you have to offer would be greatly appreciated.
many thanks in advance
zach
Use the showsCameraControls and cameraOverlayView properties of UIImagePickerController to add custom overlay above the picker (using a view with a transparent background in which you add some elements as subviews to overlay / frame / mask some parts of the picker if needed.)
You can even use the cameraViewTransform to change the size and position (i.e. the transform) of the camera view that is capturing the camera image.

Show MBProgressHUD on iPhone app's splash screen while Core Data store is migrating to new version?

If my iPhone app needs to update the Core Data database, I would like to show an MBProgressHUD view to users while my iPhone app is loading, so they know that it's working and not hanging. How might I go about adding an MBProgressHUD to the splash screen while the data store is migrating? Normally I would attach it to the UIViewController's view, but the splash screen is under the app delegate. Is this possible to do?
No it is not possible to overlay anything over the splash screen as it's static.
You could, however, delay the intensive process for a bit until the app loads, then create a fake splash screen with the progress indicator while the intensive stuff goes on in a background thread.
You could create a #define macro in your application delegate header file (or in a "globals" header), like so:
#define MyAppDelegate [[UIApplication sharedApplication] delegate]
Then, when you want access the application delegate property, you can do so like this anywhere in your application you have imported that header (or the globals header):
MyAppDelegate.property = foo;
[[MyAppDelegate property] bar];
This may help you manage your progress view at any point in the app's life.
EDIT
sudo rm -rf is correct that you can't do work during the splash screen. But you can start your progress view in the app delegate's -applicationDidFinishLaunching: method, and then launch work on a background thread. Once your background thread's work is finished, have a callback dismiss the progress view.

Resources