I have only one view controller with collection view in page view controller and having search button on the navigation bar when i click on search bar and did search then the result is shown properly means child view controller is updating but when i slide it on left it also showing me the original content of collection view also. how can i remove that previous view controller and show only result child view controller.
Then you dont want a page view controller, A pageview controller will reuse the single child view controller each time the swipe is detected. In your page view controller delegate methods properly check the values from which it is being loaded is the array being reduced permanently or are u using a mutable copy of the array each time you reload the page view controller contents.
I answered a possible solution to a similar question. Maybe it will help you.
UIPageViewController keeping previous ViewController on the Background of the view
Related
I am implementing filters in my ecommerce iOS app. I want my filter functionality similar to ebay filter functionality.
Like in the gif attached when user taps on sort filter, the next view (maybe a view controller) opens and shows possible sort options. I am trying to replicate this functionality.
What i tried.
I have implemented a container view controller in which i am showing the filter options. when user taps on any filter item, i am performing a push segue(using storyboard) to next view controller in which i am showing relevant filter options
But the problem.
When i tap on any filter item to proceed further, my app opens the next view controller in full screen, not in the bounds of the container view controller.
See the gif
So how to restrict the next view controller's frame to its parent container view controller?
Also the height of the next view controller should be equal to the number of items in it. See the ebay filters gif. (This is secondary requirement)
Any help would be much appreciated.
I will suggest your view hierarchy should be like as follows.
Embed your container view controller (main filter screen) inside a navigation controller by going into editor (xcode menu) ==> embed in ==> Navigation Controller (story board should be open).
On didSelect method of container view controller, push your inner filter Controller by either storyboard segue or programmatically.
You need to make the view controller that wants to present define a presentation context, and then on the other view controller, make the presentation overCurrentContext. That should make the other view controller present itself only over the context of the parent.
This is the similar presentation style that is used on popovers.
in the google maps app for ios. When you select the settings button, it will show you a view of options such as "traffic", "public transit", etc.
My question is how this is done on ios.
I tried following this tutorial but it says that it won't work on uinavigationviewcrollers. I have seen this partial segue of the the view in apps that use a navigational controller. How do they create that?
It's not a partial segue. It's not a segue at all, it use of containment view controllers.
Instead of a single view controller which transitions to a different view controller image one single master view controller. For simplicity, we'll say this view controller has two views (of the root), both of which cover the the whole screen. For this example let's think of them as "main" view and "menu" view.
Other than these two empty views, the view controller has no content. That's because this view controller does nothing other than manage other view controllers which get stuck into the two views. It will have a couple methods manage them, like presentInMainView:(UIViewController *)viewcontroller and presentInMenuView:(UIViewController *)viewcontroller
When the program starts running the master view controller will programmatically add the map to it's "main" view. The map view controller now cover the whole screen and looks and acts like it's the top level view controller, but it isn't. It's contained. At some point some taps the settings button and the map view controller will make a call to it's parent and say presentInMenuView:... and the master view controller will then load up a second view controller into the menu view. The menu view could even be located off the left side of the screen and the master view controller animates the menu view frame to side it right covering the whole screen. Assuming the menu view controller only has content which covers the left half of the screen you'll see the map view controller hiding behind it.
That really only scratches the surface, lots can be done with container view controllers. You could create a container which lets you brings up a dozen different views all populated with view different view controllers. You could size and arrange them on all over the screen and each child view controller could still only have to deal with it's own contents.
For more info there is the Apple Developer Guide and the WWDC 2011 Videos where it was introduced (session 102)
I used SWRevealViewController For similar type of sidebar animation.They given the good example of how to use SWRevealViewController also please try it once.
In my app delegate I create a UISplitViewController. I set the delegate to be the detailViewController.
When I run my app in portrait, I have the left top popover button showing that will slide out the split view master.
Then I have a button in my detail view that resets the splitviewcontroller array with a new detail view controller and sets the split view delegate to that controller.
The second detail view displays properly... but I lose my popover button on the second view controller.
Does anyone know how I can get that button to remain on all of my detail view controllers I may add?
Thanks!
See http://www.raywenderlich.com/forums/viewtopic.php?f=2&t=1546 for what I find to be a good approach.
It involves setting the SplitViewController delegate to be the master instead of the detail. The master keeps references to the popoverController and the button, and each time the delegate methods are called (hide and show master) it gets the current detail view and performs the necessary action (add in the button/remove button and popovercontroller).
The master defines a protocol for "SubstituableDetailView" which contains the two methods for showing/hiding the button.
I'm using page view controller with a button on top right. on click of it it will show pop over view which has table view. (Table view has list of URL's)
On selecting a cell, i want to push a view controller which has web view that shows the URL in the cell.
Upto showing pop over its fine. I'm not able to find a solution on how to push another view controller.
Any solution for this?
I added a protocol in my table view controller class and implementing the delegate methods in Root View controller. When the cell is clicked I am calling appropriate delegate method which instantiates the next view controller and pushes it from navigation controller.
I have a split view controller that has a table on the left hand side, and a empty detail view controller on the right had side. For iphone, I know its possible to push a view controller and a nib in a navigational stack. I want to know if its possible to push a view controller + nib on the detail view, after a user taps the table cell.
I tried simply pushing the view i have after a user taps to the detail view, however nothing happens.
To do this you'll need to make sure you have a UINavigationController on the detail side of your split view controller. You can set a navigation controller as the detail item within the nib that contains the split view. You can set the navigation controller as the split view delegate and use the delegate property to push views onto the stack in response to events happening on the root view side.
ya u can do that check out this example here
http://developer.apple.com/library/ios/#samplecode/MultipleDetailViews/Introduction/Intro.html
and to make navigation controller in detailview of split view check example here
http://www.cimgf.com/2010/05/24/fixing-the-uisplitviewcontroller-template/
i think it will help you
Have you tried just going to the developer.apple.com and use the standard example from Apple, which does exactly what ur saying?
Cell 1 = loads Xib1
Cell 2 = loads Xib2.
Maybe give that a go..