I want to add multiple view controller in a page controller so that view controller can scroll left and right side in page view controller.
How to do like this..?
You need to implement the UIPageViewControllerDataSource. All the documentation is found here:
https://developer.apple.com/library/ios/documentation/UIKit/Reference/UIPageViewControllerDataSourceProtocolRef/index.html
In the
pageViewController:viewControllerBeforeViewController:
pageViewController:viewControllerAfterViewController:
methods you return the UIViewControllers you want to show.
With the
setViewControllers:direction:animated:completion:
method from the UIPageViewController you can set the initial UIViewController.
Related
I have a view controller along with .xib created and also a story board. Now i want to have this viewcontroller's view to appear in the storyboard between the navigation bar and the tableview. I thought of dragging a new view controller and have that class point to the view controller i created. Is this solution correct?
Yes that is correct, drag a view controller from the object pallete, change the class name to your view controllers class name and party on. Hook up any segues in the story board you need to it.
When I use storyboards and drag out a navigation controller from the object library in Interface Builder, the root view controller, which comes with the nav controller, is always a table view controller.
Most of the time, I would just like a simple view controller. Is there a way to drag out the navigation controller and have a simple view controller set as the default, instead of the table view controller I'm getting now?
Thanks in advance!
The navigation controller usually comes connected to another controller which is the root controller. You can always delete the segue and table view controller, drag out a View Controller and reconnect the segue with a control click using the rootViewController option.
i have one navigation controller, by using that i am pushing my view
here my problem is how to know that which view is presently appearing on my navigation controller
can any one of you give me the answer
Probably you want to look at the topViewController property of your UINavigationController (or perhaps its visibleViewController if you are using modal views). The current view would then be referenced by the view property of the returned controller.
I am trying to implement a popover view in a tableview controller. My intention is for the user to select an option from the table list as shown below.
Note that my popover view actually displays the data from a separate table view controller. I am creating the popover view controller via the following initialization method
self.popOverViewController = [[UIPopoverController alloc]initWithContentViewController:optionsTableViewController];
After the user selects an option for example "Hottest All Time", the control should be passed from the tableview Controller (in the popover view) back to the MAIN table view controller (parent view) so as to trigger a table reloadData method.
Query: Is there a way to return the control from the tableview controller in the popover controller back to the MAIN tableview controller?
Do I have to use a delegate method to do this?
The two approaches I've seen are roughly the standard sort of fare:
create a delegate protocol for the class type of optionsTableViewController, have the controller that creates the popover implement it and set itself as the delegate when issuing the popover
use the NSNotificationCenter (which actually fits the intended purpose of the thing if you've a one-to-many message, as may be the case if you've a popover with a setting that affects a bunch of different controllers and you don't really care which is visible when the user requests the popover)
i want a TabelView-Navigation and permanently a TabBar at the bottom .
I pushed the TabBarController. It contains a list of Controllers (ViewController, ... and the TableViewController)
But if i navigate down in the TableView the TabBar moves to the left outside the window (like the old Table).
How can i use the TabBarController without losing him?
The UITabBarController needs to be the root view controller. It sounds like you are pushing a UITabBarController onto the stack of a UINavigationController. What you want to do is make the UINavigationController one of the view controllers managed by the tab bar controller.
Do this.
Create the Tab Bar Controller and set it as your rootController.
//You will not have three tabs and you need three view controllers//
Set your First View controller as a Navigation View controller.
// You will now have the Navigation bar at the top//
Create a new file which is a subclass of the UITableViewController.
// set this as your delegate and datasource for your table view controller methods//
// pull a table view controller inside the Navigation View Controller as mentioned in (2) & you will have a tableview and navigation view in FirstViewController. Similarly work with the other two tabs
If you have any more doubts; please watch this tutorial on how to do all of these.
http://www.youtube.com/watch?v=LBnPfAtswgw