Navigate between detail views of a table view controller - ios

So I have a UITableView that navigates to a detail view when a cell is selected. Each cell and it's detail view passes through different data depending on which cell is selected. On the storyboard it is one generic detail view with a text label and an image view that loads in data from an array.
What I want to do is navigate from the current detail view to the next detail view (for the next item in the table) without having to go back to the main table view controller. How can I do this? I would like to do this with a button.
I have looked at this but I can't seem to get it right/not sure it's exactly the same thing: Navigate between sibling detail views of a parent table view

Related

How do i get the title of a table view cell in a different view controller in xcode?

I'm currently using a table view and table view cells in a menu. When you click on one of the cells, it uses a segue inside storyboard to take you to a different view controller depending on which cell you click. They are all different links and the same view controllers except that I change which link opens on which view controller. I know this defeats the purpose of OOP because I'm having individual view controllers do pretty much the same task instead of not having one link opener view controller. How do I get the names of the table cells dynamically in the view controller after a segue?

How to show data only one view controller ,on click collection view cell?

I have JSON response. I want click on collection view cell(0), cell(1), ..., etc.
data show only one view controller then i click cell.

Page View Controller showing previous view controller after adding subviews

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

Switching between data in detail view of parent table view

So I have a UITableView that navigates to a detail view when a cell is selected. Each cell and it's detail view passes through different data depending on which cell is selected. (On the storyboard it is one generic detail view)
For example I have three choices on the tableview: Page One, Page Two and Page Three. When I pick Page One for instance, there will be a button on the detail view which would allow me to go to the next page - Page Two, and if I selected Page Two the button would bring me to Page Three and so on.
I am not switching between different UIViewControllers, I am switching between the data that is passed through from the table view. How can I do this?

Drill down, UITableView and GridView

I have a UIViewController with an UITableView and a NavigationController to implement a drill down navigation system. The user can browse a hierarchy of folders and documents.
I am using a NSFetchedResultController for populate the UITableView from a data base.
I would like to add the option of browsing the hierarchy using a GridView (fe: AQGridView). The idea is to have a button on the navigation bar for switching between
tableView and gridView.
Problem/Question 1:
What is the best way for switching programatically from the controller with a table to the controller with a grid?
Problem/Question 2:
After switching, if there are other controllers pushed into the navigation controller,
and the user goes back, these view controllers will be presented without any change. How can I update these view controllers? For example: the user switches from table to grid, then goes back, and after pop the current controller, the user sees again a table -> wrong.
Where you display the top level of the hierarchy (the UITableView), you would want add a UITableView or a the grid view as subviews when requested.
You would add methods to your view controller:
-(void)displayAsGridView {
// hide/remove the table view
// populate the grid view and display
}
-(void)displayAsTableView {
// remove or hide grid view
// make sure the table view exists, if not, create it
[self.tableView reloadData];
}
In the table's data source:
-(UITableViewCell*)tableView:(UITaleView*)tableView cellForRowAtIndexPath:(IndexPath*)indexPath {
// you populate the view cell as you would for any other table
}
You can create both of those either in IB or entirely via code, whichever suits you best. The point is, you would not push either one of those onto the navigation controller just to rearrange how the information is displayed.

Resources