Load a tabBarController from a UIButton in a subview - iphone

I am working on an app where i have a view controller that contains a view in that view i have a button that when pressed i would like it to load my tabViewController.
I trying to get a splash screen to load before my app so i can do some downloading and parsing of data before i load my tabViewController because the data im putting the data into a tableView that is in the tabViewController.

Here's a good example on creating a splash screen
http://adeem.me/blog/2009/06/22/creating-splash-screen-tutorial-for-iphone/
I would suggest that you look into using performSelector and launching a background thread
before putting your splash screen up to populate/parse the data.

Related

how to hide/ show custom toolbar(s) in a subclass of uiimage picker controller

I subclassed uiimagepickercontroller for a camera based application, and added two custom tool bars.I want to navigate to another viewcontroller before taking a photo and the custom tool bars hidden in the new view.Till here it is working fine.But when i pop back to camera view controller,the tool bars are still hidden.Where exactly should i write the code to unhide the toolbars?? I wrote the code to unhide in viewWillAppear method of camera class.But it is not working
it is correct to write the code under viewWillAppear, but it should be in the viewController (UIViewController)

Perform Segue from View

I created a view that will look like a splash screen and which will be loaded when the app is first started. I have also created a segue that will take from the initial splash screen to the main view after some certain background tasks have been performed. However, I have no idea how to initiate the segue since I don't have any user interaction within that splash screen. Does anyone have an answer to this problem?
If you have an UIViewController created from the storyboard, you can start a segue in code using performSegueWithIdentifier:sender:

View controller IOS switch between views

I am new at ios programming and I need some help, can't figure out how I am going to switch between two views without firing a button event
I have a splash screen waits for 2 sec then it should go to main view. I don't know how I am going to acquire the main view's reference and navigate to main view!
Any tutorial about switching between views programmatically?
Thanks for your help.
Cheers
For Splash screen you have to name it Default.png and in appDelegate didFinishlaunchingMethod, you have to add view controller to window. the Default.png is automatically reference as a splash screen. try it out
Start with one of Xcodes default projects, and see how they are setup. They should give you a window, with a main view out of the box.
If you add a Default.png image file to your project, it will automatically be used as a splash screen and displayed upon startup. However it will not be visible for 2 seconds, but rather as long as it takes for the application to start.
If you want it to be displayed longer, you will have to add a UIImageView with the same png image to your mainview, then remove this from your mainview after two seconds.
You can use performSelector:withObject:afterDelay to trigger the hiding of the UIImageView after a period of time. However this goes against Apples design guide, as the splash screen only is meant as a ting for the user to look upon before the application launches.
As for adding new views, I recommend using a UINavigationViewController. Using this enables you to navigate back to the main view, and you also get a nice animation as a transition between the views.
If you want to switch between views you use addSubview
maybe this tutorial will help ->Tutorial

Media Type Splash Screen in iPhone iOS

Wanna create a custom splash screen for the iPhone, but Im asking for opinion from all of you.
For what I understand, the splash screen is only a image (Default.png), so if I want to make the splash screen longer, the only way I can do is create a image then add the subview to the front? Then create a timer to call a method to remove the image from the view.
But then I want to create a media type splash screen, which will show audio, video and etc. So the question is what flow will it look like. The only way I think of is create a ViewController, then present it in a modal view. Later I also will add in an option to detect a tap from user, if tapped then the media will quit/hide/dismiss the fake splash screen and present the main view controller.
For now the flow of my thinking is like this:
AppDelegate --> RootViewController --> SplashViewController(Modal View)
is it possible to make it like this?
AppDelegate --> SplashViewController --> RootViewController
Is there any other way to show the media when the app start?
Any answer is appreciate, thank you in advance.
set the root view controller of your navigation controller to Be your splash screen.
Then just dont allow the user to navigate that low.
after the timer lapses, push onto the nav with animation:NO and your splash screen will be replaced.
Alternatively you can add your splash.. and when the timer lapses, you tell the splash screen to remove itself from its parent view, then add your root controller.

iphone - How to tell which view is currently loaded in a tabBar app?

Here is my scenario. I have 3 out of 4 tab views that contain UIWebViews and UIImageViews. I have the UIImageView on top of the webView to provide a loading image and I remove the imageView when the delegate method webViewDidFinishLoad: is called. This works just fine.
The problem I am running into is trying to handle the method webView:didFailLoadWithError: if/when my web content fails to load. my webViews are different sizes for the 3 tabs so what I'm trying to do is if self.view equals one of my views (with webView) then add the subview (imageView) on the current view.
Basically I wan't to show an error image if the load fails in place of the loading image that is there for when the webView is loading. I do not know how to tell which view is currently loaded.
I hope this makes some sense.
You can get the current view controller with -[UITabBarController selectedViewController]. Then use that view controller's view property.