Scrolling view controller with Navigation Bar - ios

I have a view controller with lot of data under a navigation bar.
I want to make a transition to other view controller which looks like I'm scrolling them.
My idea is to have 3 elements at the same time and charge them into a scroll view and when I scroll to other view controller release one of them and charge another view controller to have 3 every time.
Somebody know an easier way?
Thank you all for your time.

If you only have 3 elements, then use a single UIViewController with a scroll view that contains the 3 different element UIViews. If you are looking to scroll through a larger set of data and want to view only 3 elements at a time, then go to a UITableViewController and implement your views as UITableViewCells.

Related

Animation bug with always displayed large titles after popping view controller

I wanted to use the new Large Titles with largeTitleDisplayMode set to .always but got some strange animation issues while popping the pushed detail controller if the root UITableView's contentOffset.y is positive aka scrolled.
So this is how it should work:
And this is how it works after scrolling:
I guess it's a bug, but maybe anyone have a workaround till it's fixed?
To reproduce, create a new sample project, open Storyboard and do the following:
Add Navigation Controller and tick it's Navigation Bar's Prefers Large Titles value
Select it's Root View Controller and set it's Table View's Content to Static Cells.
Add many static cells or make then big enough, so your Table View become scrollable
Add a View Controller as detail view controller and setup the Show segues
Setup the Navigation Item's Large Titles property to Always for both view controller
Run the app, scroll to the bottom, perform a show/push segue and pop back

Swipe to the same Viewcontroller

I am trying to implement a left-right swipe gesture to navigate between an array of objects, that i can change the properties and take actions. The navigation is more of a previous-next approach. I have a table view that segues to this Viewcontroller, and i would like the user to check the next object without getting back to the TableViewcontroller. What is the best approach to implement this?
I know PageController isn't ideal in my situation as i'm not navigating between different VCs.
A page view controller is the best way. Make the views view controllers instead. It does all the work for you.
Failing that you could use a collection view with a custom flow layout.
Failing that, you could roll your own custom view controller that implemented this feature.
EDIT:
Based on your screenshot, where you say "swipe back and forth to move between rows of a table view" you need a collection view. Table views scroll up and down between rows. That's what they are made to do, and trying to implement a swipe interface to instead scroll side-to-side is crazy. Simply use a collection view configured for horizontal scrolling between cells.

Overlapping UIViewController with another UIViewController Using Swift Programmaticaly

I have this problem and I can't seem to find the answer so I asked here. I need to overlap 2 UIViewControllers. It is in a navigation controller. Each Controllers is using xib files as view since I am not using storyboard. It needs to be overlapped since the first controller is on live feed and I cannot afford to use a screenshot for background to make the live feed stay on while the user is navigating on the second controller. Any Ideas?
try content views doc tutorial
and the VC which you want to overlap, you will not keep it in you navigation stack, you will have to make overlapping VC, child of the VC on which you want to present it, after making child you will add child VC's view as a subview to parent's view. in that way both view controllers will appear to be overlapping

Designing view on top of multiple embed views

I have the task to design a application that has a main view which is always visible (it has a button on it's bottom side, and when pressed a image displays on top of all views), and a set of TableControllerView's that should appear under it, and the user needs to be able to navigate through them.
I know that you can embed a view inside another, but you cannot refer more than one view to it. The current way I'm trying to do now load one TableViewController inside the embed view, and when the user clicks the cell I manually load the other controller and add it as a child of the main view, which is the RootViewController. The problem with this approach is that the navigation bar gets stuck using the root view controller, so I have to manipulate the main navigation items on each subview transition, and second is that the frame for the second view I load is coming as it had full size, making some cells be under the main view button. This way doesn't uses segues for transition, so it makes the storyboard kinda useless.
I was thinking into using a TabViewController with it's tab hidden, but wanted to ask here for a better solution.
As you discovered, a TableViewController likes to fill up the whole screen (except navigation bars, tab bars, status bar, etc. which are official Cocoa Touch GUIs). When you want a table view to fill only part of the screen, you are supposed to use a UITableView but not a UITableViewController. You set your custom view controller object (subclass of UIViewController, not UITableViewController) as the table view delegate and data source. You will need to duplicate part of the functionality of UITableViewController in your custom view controller, but it's not a lot more than you have to do already to supply the data.
You should probably follow the standard design pattern and have separate view controller objects for each of the "pages" the user can navigate to. You just have a main button and image on each of them. But I could imagine why that might not give you exactly the effect you want.

How can i add six controller in an uiscrollview?

My Question is little bit bigger so apology for that. Now my problem is i have to set a tabbar controller where first tab will contain an UIScrollView with an UIPageControl, until now i have made my tabbar controller with scrollview and uipagecontrol but i am becoming unable to add uiviewcontroller with every page control in the uiscrollview.
Any suggestion and link of source code is great help for me.
Thanks In Advance.
If it's essential for you to have a separate view controller for each page, the proper way to do this is to use view controller containment, whereby you have your scroll view act as a container for the subordinate view controllers. I recommend reading the UIViewController documentation, particularly the section entitled "Implementing a Container View Controller".
I have done this solution very simply. I have taken one UIScrollview in my main controller where my scroll will work.
In viewDidLoad i have take UIscrollview and load first,next and previous controller as a items of the scrolled view.when i scroll, then respected view controller load on the page of the scrollview.
I also take a uipagecontroll in the viewDidLoad.

Resources