how can i use uipagecontrol for a page with actions? - ios

I want to create a page where the user can enter his/her details and then swipe through the next couple of pages which will be tutorial screens. I want the page controller to be present through the tutorial part and the part where the user enters their details. Almost all the tutorials I found used images and page control in conjunction.
Initially i thought that i could do this using uipageview controller, but then i realized that you can only put in images for tutorials!? Correct me if I'm wrong.
So now I'm considering using a scroll view with page control, but I'm not entirely sure about how to go about doing this.
Could somebody shed some light on how this is possible?

Yes it's possible. From UIPageViewController reference guide:
A page view controller lets the user navigate between pages of
content, where each page is managed by its own view controller object.
Create a UIViewController with the login UI and logic then add it to the UIPageViewController.

Related

In Xcode, how would you go about having view controllers which are only accessible to the user if they perform a certain action in the app?

The app I am making has multiple pages which the user swipes between. I need the user to be able to press a button and that create a new page in the app, and then also for the user to be able to delete that page of the app. Is there a way to generate/delete a view controller while the app is in use? Or do I need the view controllers already to exist and somehow lock/unlock them when the user adds/deletes them?
You don't have to create all the view controllers already and somehow lock/unlock them when the user adds/deletes them.
You can use UIPageViewController for this purpose. Using UIPageViewController you will able add and delete view controllers.
Another way of implementing the same feature without the use view controllers as page is by using a UICollectionView with its cells as page and paging enabled. Here in this case the size of the collection view cell be same as the size of the screen.
To have a snapchat like multiple view controller you could probably use a UIPageViewController with your custom views or a scroll view with paging enabled.SwipeView also seems like a nice implementation. see this stack overflow post for some other options and some implementation methods.

prevent scroll to one page in pageviewcontroller

Is there a way to prevent swiping to one specific page in UIPageViewController
In my case, I need the left page just to be accessible sometimes,
Thanks!
No.
You will need to set up your page view controller without the page in question, and then add it when you want it to be available.
I would suggest changing your design. Page view controllers aren't intended to handle a case where the set of pages displayed changes. The real world analogy is a book where a page appears sometimes and not others. It doesn't make sense.
Instead you might want to present a modal view controller when you want this special-case VC to be available.

How to implement the Facebook App iOS UI with Xcode Storyboard?

I'm trying to build an app that has lots of similarities to the Facebook App in terms of the "Storyboard". I'm tempted to do everything in code as I know best but I'd really like to figure out how to storyboard these more complicated UI's.
The Facebook App starts with a login view. When you log in, you get a tab view. In the main tab view, you have a table view. Within each table view are a user, post, and comment buttons which push to a new view.
So the way I am understanding it is we have UINavigationController with the .navigationBarHidden set to false. The first view controller here is the loginViewController. When the login button is pressed and the user is logged in, we performSegueWithIdentifier to a UITabBarController. The first tab is a UINavigationController with a UITableViewController as the first view controller. Clicking user, post, or comment pushes the appropriate view controller onto the NavigationController.
This all begins to seems a bit more complicated than just writing this all out in code. I'm also not even sure this implementation is correct with all these nested view controllers. I'm not sure this is all possible with storyboard as well: for example a navigation controller for pushing to comment, user, or post views doesn't seem possible with storyboard.
I'd like to know the correct way of implementing this kind of UI design. And should / could this be implemented using Storyboards?
Your design team may layout the app using a "storyboard" (physical objects -- not the digital version). Large apps are hard to piece all the little things together on a storyboard. Just too many wires going every which way.
Look at the FB app without internet access and you can see their basic building blocks easier. Its built in units (post at a time) that are added to a scrolled view. Search bar and menus at the top and buttons at the bottom with the scrolled view in the middle. The posts probably have some common base class with various types derived from it (picture, video, links, etc).
There is some sort of background process monitoring the position of the scroll view to dynamically load new stories if you get down within 1/3 of the way to the bottom. Within each post you can see the components if you look closely and think about what sort of block that is.

Is it possible to have multiple UIViews inside a UIPageViewController

I am trying to set up a UIPageViewController that swipes through three very different views. I need to have a UICollectionView, a UITableView, then another UICollectionView with a different format. Can anyone clarify, whether this is possible or not? I have been searching for the last couple days and have not found a definitive answer. I am not asking for someone to solve this for me, I simply want to know if I should give up and just go with a different approach.
Yes, it is possible.
From the UIPageViewController Class Reference:
A page view controller lets the user navigate between pages of content,
where each page is managed by its own view controller object.
You need to have a viewController for each page. I recommend you read here: https://developer.apple.com/library/ios/documentation/uikit/reference/UIPageViewControllerClassReferenceClassRef/UIPageViewControllerClassReference.html
You certainly can. The UIPageViewController is made to display different view controllers.
Try it for yourself, it's not that hard. You'll need to implement a UIPageViewControllerDataSource to return your different UIViewControllers, but that's about it.
Yes, you can have different views inside a UIPageViewController. That is the first line in Apple documentation of UIPageViewController
https://developer.apple.com/library/ios/documentation/uikit/reference/UIPageViewControllerClassReferenceClassRef/UIPageViewControllerClassReference.html
A page view controller lets the user navigate between pages of content,
where each page is managed by its own view controller object.
Below is method is used to set the view controllers to be displayed.
setViewControllers:direction:animated:completion:
For tutorials/sample-code, you can go through below:
https://developer.apple.com/library/ios/samplecode/MyImagePicker/Introduction/Intro.html#//apple_ref/doc/uid/DTS40010135
http://www.appcoda.com/uipageviewcontroller-storyboard-tutorial/
Go through these links and then start coding your requirements. You will be good to go then.

Programmatically load the initial view controller from storyboard IOS5

I am creating a login type functionality for my iphone app. I've laid the whole thing out in storyboard. I have set a condition that keeps the user logged in for a day. Then after that, the application should direct them to the initial view controller (a page where they have to enter login credentials).
I was planning on putting this logic in the AppDelegate (app did load). If there is a better place to put this logic, I'd be open to that. But how do i access and load the initial view controller in my storyboard?
The reason I can't just load a segue to this initial view, is because I won't necessarily know where the user last left the application. And i don't want to create individual segues from each view back to the initial view.
Thanks!
EDIT! In response to Luis's answer
Okay, great! I added a navigation controller at the beginning of my starboard, like the first character suggested. Now, I'd like to go back to the navigation controller every time I open, or re-open the app, so that the navigation controller's logic executes. Thanks
Read both of the answers provided for this question, the first approach is easier but you have to do what you just wrote you didn't, the second one is what you are looking for but its way more complicated.
iOS 5 storyboard, programmatically determine path

Resources