How to use UIScrollView with ViewControllers from Storyboard - uiscrollview

How would I use a UIScroll view (much like the main iPhone screen) with the page control at the bottom, pass UIViewControllers?
I have three UIViewControllers,that I would like the user to swipe back and forth. However these are already created in a Storyboard. I want the entry point to be the middle viewController and have the user wipe left and right to get to the 1st and 3rd view controller.
Am I right to assume that swiping is built into scroll view's with paging enabled?
Thanks in advance
-PaulS.

Related

Change relationship segue order of appearance in WatchKit

Current storyboard looks like this:
The above picture shows segue from main screen to settings screen.
I still want the mainView to appear as initial interface controller. However, can I reorder the settings screen to appear left of the MainView instead of right. In other words, upon launching the app, MainView shows up first and upon swiping to the left the settings screen comes up from right. I want the settings screen to come from left upon swiping to the right.
Like this

How can I make the top and bottom elements of my view controller stay in place, while the middle has elements to vertically scroll through?

I'm working in Swift 3 and XCode 8.
I tried to find the answer to this question, but maybe I don't know how to ask it properly. I'm trying to have a title bar at the top of a view controller and have a back and next button at the bottom of the view. The content in between is longer than the space that exists, so I would like the user to be able to scroll the middle, but keep the top and bottom elements anchored in place.
I've tried to use a container with another view controller that is larger than the container to make this happen, but it just resizes the child view controller.
If I'm not explaining something properly, please let me know and I will try to give more information about what I've missed.
I'm making a few assumptions about your Views:
Navigation Bar for your title
Toolbar to hold your Back and Next buttons
Try the following:
Place a Navigation Bar as seen below. Do not set any constraints.
Place a Toolbar as seen below. Again, do not set any constraints.
Place a Scroll View in the centre of your View Controller and expand it so that the top and bottom are aligned with the navigation bar and toolbar respectively. Again, do not set any constraints.
Highlight all of the Views in the View Controller and place them in a Stack View.
Pin the Stack View to the Superview. These are the only constraints that are set in the example below.

Xcode Storyboard - Table View doesn't expand automatically when dragged in

In Xcode 7.3, when I drag in a Table View from the Object Library to the Storyboard for a single view app, it doesn't automatically expand to the full size of the view. I seen it do that in my Udacity class videos and in other videos on YouTube. Is there a setting in Xcode that will correct this? Thanks.
Yes, you need to "pin" the tableView at the ViewController. Am I right you have a simple ViewController and add a tableView to it?
Now, you need to open the Pin Menu and uncheck the checkbox "Constrains to margins". Now you add the constrains to the top, left, right and bottom to 0 and save it. Now the TableView should stretch the whole display.
If you only show a table in the ViewController you should use a UITableViewController.

How to drag a View Controller on top of a View Controller?

I have a View Controller that is presented when you first open the app, and I have another controller that can be shown on screen if you tap a button at the top of the screen. However, instead of doing it this way I was wondering if I can either drag the view down or tap the button and have an animation take care of that.
I have tried doing this with a PageView Controller, but this doesn't show the effect I wanted as it simply translates over to the next view and doesn't actually keep the initial view fixed in place while the second view slides over it.
Also, instead of a view controller would a view initially placed out of bounds in the main View Controller work? Thanks in advance!
You could use a side menu like MMDrawerController that has 4 type of animations for presenting the viewController.
Or you can create your custom UIView (not viewController) even using Interface Builder and animate that screen yourself. The animation can be started using UIScreenEdgePanGestureRecognizer.

Create Back Button with Storyboards

I currently have 3 tabs connected to a common UITabBarController. When one of the tabs is selected the user is taken to a UITableView with 3 cells which can be selected. When a cell is selected the user is taken to a new page with a UINavigationBar at the top. My understanding is that the UINavigationBar is supposed to include some sort of back button and I couldn't figure out how to enable it.
In place of the default back button, I dragged a UIButton to the corner and connected it to the 'Show Detail' property of the previous view but when I press the UIButton I am taken to the right UITableView but the tabs are missing for navigation. What am I doing wrong? My segues look like this:
The UINavigationController has the back functionality. How to go back one view in UINavigationController?.
Here is some old tutorial on how to combine that with a tabbarcontroller. should still be the same principles.

Resources