Navigate from an embedded UICollectionView (inside a UIContainerView) to a UIViewController - ios

I have a UICollectionView which is embedded into a UIContainerView. So I want to navigate from this embedded UICollectionView to an independent (not embedded) UIViewController but it throws an error. I know it should be pretty straightforward to use either a Segue or self.present etc. but in this situation it doesn't allow me to do it. Embedded CollectionView looks like the dead end. How can I navigate to a new UIViewController from an embedded CollectionView. Please see the image. Thanks.

There is no such thing as navigating from a View to a View Controller. It should be View Controller to View Controller. Don't try to take a segue from a View to a View Controller. Try to take it from the View Controller which has that UICollectionView.

Related

Pushing a ViewController Through a UIScrollView

I have a custom uiscrollview class that has certain views and buttons. When I press a button in this custom scrollview, I want to present a new viewcontroller. Since this scroll view is inside of a view controller, and the custom class doesn't have the authority to push view controllers like a navigation controller, how do I push a new view controller through this uiscrollview class without throwing an error? Whenever I create a new navigationcontroller and an instance of the viewcontroller that I want inside of the method for when the button is pressed, and I present that viewcontroller, I get an error. Also, all of this is programatic and dynamic, not though storyboard. Thanks.
The scrollView must be inside a viewController.
The best way to accomplish your scenario is to put the viewController that contains the scroller inside a navigationController, Then you can push to wharever you want.
Hope this may help
You can try to instantiate viewController through the storyboard, or directly from class, after that present it as a modal view controller from your source UIViewController like this
presentViewController:animated:
This possible leads to animation issues, that could be solved implementing your own animation

ContainerView nextViewController is not child stacked to container view as subview

I have 3 View Contorller
First View controller have Container View of height 300.0f at the center.
It has one embedded view Controller which is table View controller.
On cell selection it should navigate to detailsViewController.
All the process is ok.
But detailsViewController is not behaving as embedded view controller of containerView and not of same size as container view.
It takes whole screen size.
As it is triggered from the embedded View Controller it should follow that frame without overlapping other controls which are in First View Controller.
You need to embed not view controller with table view, but embed navigationController(you can hide navigation panel on up side), end set yours table view controller as root for it, and use pushViewController to go to detail page.
hope ganesh this will help you
Look You have a Container View inside it you have a tableView and By clicking an cell you pushing another viewController that what i concluded after reading your question(hope you done everything in modular way).
Now you must have UIView subclass(i.e separately creating a view class ) inside which you have a tableView so you pushing by
[self.nav pushViewController:sos animated:YES];
there are two way to push ViewController inside a view first by Callback(through blocks) or passing Navigation ref. in UIView Class .So you are pushing the new Controller over the navigation thats why it showing this behavior and which is obvious.

how to implement pushing functionality inside UIPageViewController

In my project i have one pageviewcontroller it's manage three viewcontrollers. First viewcontroller is a tableviewcontroller second one is UIViewcontroller .By normally i can scroll the viewcontrollers using pageviewcontroller scrolling functionality. It's ok for me, but i need one more thing using pageviewcontroller when i select one row of tableviewcontroller i need to push (scroll)to second view controller. How can i do this using pageviewcontroller, after this i need to sroll back to firstviewcontroller.
please help me
Here is a page control on github link. This uses viewcontrollers for every page. Just use NavigationControllers instead of these viewcontrollers and set the desired view controllers as root View controller. You will be able to push and navigate through screens.

Cannot see controlls of presented view that I dragged on stroyboard after calling presentModalViewController

I am a newbie in iOS developing. I am trying to accomplish a sample from a book, but I use storyboard instead of xib. I added some buttons to one of the view and assigned a viewcontroller to it. I tried to call presentModalViewController to show the view in a action, but it seems nothing on the presented view. I add some code in viewdidload, and it works. But why can I see the buttons that on storyboard?
You should be using performSegueWithIdentifier:sender:, rather than instantiating and presenting the view controller yourself. Only then is it deserialized from the storyboard.
If you really want to just use the storyboard as a holding area for your transitions, deserialize it with [self.storyboard instantiateViewControllerWithIdentifier:#"whatever"] and present the result. But that's not how storyboards are intended to work; the intent is to specify both the destination and the transition in your segue. That it's presented as a modal is just a part of the segue you define.
Think of it this way: A storyboard is not a direct replacement for a XIB. A XIB defines a single view controller's contents. A storyboard not only defines many view controllers and their contents, but how the view controllers interact with each other.

Adding toolbar to a ViewController in storyboard

I'm using storyboard to create an iPad app. On the main view I have a toolbar and a bar button item, let's call it "show". Then I have dragged a table view controller into the storyboard. I have also added a subclass of UITableViewController to the files and made the class of the dragged table view controller to be that subclass. And I made a popover segue from the "show" button to the table view controller. It works fine, meaning that when "show" pressed I see the popover showing the correct data that I set in the table view. What I cannot seem to figure out is how to put a toolbar on top of the table view in the popover. I took a step back and used a UIViewController instead of UITableViewController and still cannot add a toolbar by dragging it to the view. Any help will be appreciated.
I ended up putting the TableViewController within a NavigationController and the latter in a PopoverController, all in the code, without using IB. I found this an easier solution to get the toolbar than anything else that might work.

Resources