Load UIWebview on app Lauch IOS - ios

I am attempting to create an application using the webview feature.
However, I need functionality that will allow me to segue between viewControllers without the webview taking time to present it self when the viewController loads.
This will require loading the webviews on the launch of the app. Any guidance on how to achieve this would be appreciated.

You can create a singleton to hold the UIWebview. In your AppDelegate, you can initialize your singleton and load content of your UIWebview.
Everytime you want to use it, just get this view from the singleton and add it to whereever you want.

Related

IOS initial view controller based on condition retrieved from database

An iOS app I'm creating shows a setup screen upon first launch which requires data to be written to the database.
Upon launch, I need to access this value form the database.
If it is set, launch main view controller
Else show setup view controller.
As far as I'm aware theres two ways I can do this, programmatically setting it from the AppDelegate or using an initial View Controller as a splash screen and performing the look up and segue there.
What would be the best way to approach this? Is it wrong to do a database lookup in didFinishLaunchingWithOptions?
Using a splash screen is probably the better option as it provides better scope for modification in the future and allows you to update the user on progress. It is fine for the app delegate to run logic to determine how the app starts but you should endeavour to keep the app delegate minimal and focussed.
I very much doubt that you would get this approved (if your goal is the App Store). Your app delegate needs to create a window, and set a rootViewController to that window before it returns YES in appFinishLaunching:
You simply do not have enough time to check with a server before creating the first viewController and you'll be creating poor interface if you try. I suggest the first ViewController will need to be informing the user that it is checking with the server with an activityIndicator or something. The best :)

Receiving Delegate Methods for iAd Banners iOS 7

In iOS 7, ADBannerView no longer needs to be created manually. Instead, they can be requested with a simple self.canDisplayBannerAds = YES;
Now, I cannot set my View Controller as the banner delegate because there is no banner for me to access (to my knowledge).
I need to know when the banner is tapped and when that action is dismissed so I can properly pause/start my Sprite Kit game.
How am I supposed to have these delegate methods called so I can properly respond to the user's actions?
AFAIK, there is nothing in the UIView Controller iAD Additions that explains how to set the delegate for the banners.
Do I need to create the banners manually, or is there a way to achieve this while still using the newer API's?
Unfortunately, if you want to use the delegate methods, you will need to set up your iAd Banner manually. Even if you make your vc the delegate, by just using self.canDisplayBannerAds = YES, will not call the methods you need. In my sprite kit game, I made all the banners manually so I could take care of pausing the game and going to the background. Making them give you the control you are looking for. Good luck.

IPhone UIWebView Application wit AJAX

I'm doing now an iPhone App that encapsulate a web Site inside a UIWebView, the first request is made by the iphone app and it activate the "webViewDidFinishLoad" delegate, but when i press on one of the buttons in the web application inside the UIWebView this delegate is not working, do i need to do anything more in the ViewController or in the Html?
I Think i understand the specific problem: the next calls from the UIWebView are AJAX calls and it does not monitored by the webViewDidFinishLoad, i need some help, anyone know how to handle AJAC calls from UIWebView?
Thanks
Shimon
The right way to do it is to add UIGestureRecognizer to the UIWebView, and in the handler read the UIWebView string, then you can see the AJAX Updates done after the UIWebView was loaded for the first time' solved my problem

Custom iOS popup/modal view jailbreak launch daemon

I'm working on a jailbreak tweak (launch daemon) that simply listens for a certain event then will need to display a custom popup UIView when that event occurs. The popup needs to appear wherever - so either lockscreen, springboard or in app.
Whilst I have managed to get a simple CFUserNotificationDisplayAlert working, it does not offer the required functionality - I would prefer a custom view to be rendered.
I have tried using the RNBlurModalView library here, but this crashes when attempting to render the view as it looks for a base UIViewController - there isn't one as it's a background daemon.
Does anyone have any tips how I can go about rendering a custom popup view (whether it's modifying the above RNBlur library or rolling a different solution)?
Thanks! :)
What you can do is inject a dynamic library into SpringBoard in which you use the CPDistributedMessagingCenter class in server mode and you set it up in a way so that it listens for a message, then upon receiving that message, its observer object renders the custom view and adds it to the key window of the SpringBoard application itself ([[UIApplication sharedApplication].keyWindow addSubview:customView];).
Then, in the other part of the tweak (where you're currently calling CFUserNotificationDisplayAlert()), you simply use CPDistributedMessagingCenter in client mode and send it the appropriate message whenever needed.

Why does the main View Controller not unload when the app is open

I know that the main (first) view controller does not unload until the app is quit on iOS but my question is why? I believe that you know how to use something better when you know why it is done like that.
The first view controller which you typically add to the main window of your app is typically initialized in the application delegate's didFinishLaunchingWithOptions, ie. at app startup. It is the foundation unto which all other ui components are added. It is always present. If it were to unload before the app is quit then the app would no longer have a ui.

Resources