How can i add six controller in an uiscrollview? - ios

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.

Related

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

Storyboard: can't drag view to viewcontroller

I'm new to iOS, I'm following this tutorial: http://www.appcoda.com/uipageviewcontroller-storyboard-tutorial/. I just drag and dropped a Page View Controller to the storyboard, and tried to drag an Image View into it, but it bounce back, what am I missing?
When manipulating the content of ViewControllers in storyboards, the zoomlevel must be set to 100%. You might want to check this (simply doubleclick on the ViewController).
UIPageViewController is a container view controller, so you can't put individual views in one in Interface Builder. You need to create one or more individual content view controllers and control-drag from the page view controller to the page content controller and then put actual content in the page content controller.
Walk through the tutorial again, but this time note the references to "page content view controller"

Adding UIPageView as a portion of a screen

Pretty new to iOS development and curious whether something is possible and if so the best want to do it.
I'd like to make a UIPageViewController be a portion of the screen. I.e., I want to have a menu bar, perhaps some additional controls and then place the page view controller on a portion of that page (so the menu bar isn't part of the page turning control). In other words, a UIPageView that acts like a scrollView that doesn't take up the whole screen.
Acceptable design?
Thanks.
Yes, this is possible, and the implementation is very easy.
Steps (implemented in XCode 6 using Storyboards)
Begin with an empty view controller.
Add a Container View from the object library on the right. The Container View may automatically embed in a regular View Controller, in which case you can just delete the View Controller because we want to embed a Page View Controller.
Select a Page View Controller from the object library on the right, and place it wherever you want in your Storyboard.
Ctrl Click + drag from the Container View to the Page View Controller, and select embed from the menu that appears. The Page View Controller should automatically resize itself to be the same size as the Container View in the original View Controller.
A nice example from apple developer sample code: PageControl. Implemented with UIScrollView and UIPageControl.
Also you may want to create a new iOS project with template "Page-Based Application". The template code is implemented with UIPageViewController.
Both implementation employ View Controller Containment.
BTW: the is no UIPageView, only UIPageControl or UIPageViewController.
You can Try Below link for uipageviewcontroller Tutorial
http://www.techotopia.com/index.php/An_Example_iOS_5_iPhone_UIPageViewController_Application
U can Try uiview for pageturning not uiviewcontroller
u can add uiview to uiviewcontroller.
like [Self.view addSubview:youruiview];
and Remove uiview controller like [youruiview removefromsuperview];
Thanks..!

Segue from a scrollview

I have a UIscrollview that takes up about half of a screen. The scrollview contains a series of view controllers that have buttons that have segues to another view controller. When that segue is followed, it loads the view controller on top of the current scrollview.
I want that new view controller to act like any other modal segue would act if the button was not within a subview or scrollview. In other words, take up the whole screen.
Can you use segues from within a subview or a scrollview?
Thanks!
The scrollview contains a series of view controllers that have buttons
that have segues to another view controller.
An instance of UIScrollView can't "contain" view controllers -- it can only contain other views. It might contain views that are managed by other view controllers, but if you're using many view controllers all at the same time you may want to read Am I abusing UIViewController Subclassing?.
I ended up just using delegates and protocols between the views in the scrollview and the parent view controller and then I launch the new view from the parent view controller. Seems to be doing the trick.

How to display a scrollview and pageControl within a navigation view controller?

I am new to iOS development and have been fiddling with this for a while and can't seem to find an answer or get it to work.
I have a navigation controller as the root view controller of my app. There is a table and selecting a cell will open a view that I want to be scrollable with page control.
I make a new subclass of UIViewController, call it PagingViewController. In interface builder, I just drag in a UIScrollView and a UIPageControl and lay it out appropriately on the screen.
When I push the PagingViewController onto the navigation controller, the UIPageControl does not display.
When I modify AppDelegate.m to use PagingViewController as the root view controller and start the app, the UIPageControl does display.
I'm trying to figure out why UIPageControl does not display. I think it has something to do with being used in conjunction with the navigation controller, but other answers and posts I've read seem to indicate that it is indeed possible.
And yes, in both cases, I initiate the PagingViewController in the same way. I am confused. Any help would be appreciated. Thanks.

Resources