UIPageViewController overscroll is occurring - ios

I'm using UIPageViewController to house several different UiViewControllers (6 total).
When on the first or last Page of the Controller, I can scroll the Page partially out of view. Is there a way to prevent this? I want scrolling for the interim pages, but don't want the first or last page to move of the screen at all since there's nothing before or after them.
Any ideas here? I assume it should be a simple setting, but can't find it in the docs. Thanks!!!

Related

How can I have multiple viewcontrollers in UIPageViewController display at once

I'm trying to have multiple viewControllers show in a single frame of a UIPageViewController. With the current page being centred in the UIPageViewController and the previous and next cards showing on the edge of the screen
I've been struggling to find a solution. Any help would be much appreciated.
-> Like this <-
I don't think you can do what you are describing. A page view controller shows one page, or 2 pages with a spine in the middle. It has pages "waiting in the wings" for when the user flips/slides new pages, but I don't think it supports showing pages off the edge.
That said, it wouldn't be that hard to create your own parent/child view controller arrangement that does what you want. you might even be able to base it off of a UICollectionView.

How To Create Animated Onboarding on iOS

I'm creating an app that will have a quick onboarding at the beginning with some pretty simple scroll through animations and finish with a button to basically "GO" into the app's content.
I'm looking for suggestions as for how to most effectively and efficiently develop this, here's some things that it needs:
there should be paging so that it locks onto about 4 different positions throughout the onboarding.
the animations progress should be dependent on the scroll view's position (I'm guessing the x value of the content offset)
there needs to be views that stay on screen through multiple pages and some that move on screen and off screen throughout the onboard, it can not just be one picture moving on then off
there needs to be a button that pops up on the last page
I have a good understanding of Scroll Views, Page Views, and Page Controls. I also just bought Core Animator (the app) if anyone can suggest how implement that.
The way that I'm thinking of doing it is basically creating a Scroll View with paging that is empty and just use it to control animations with its content offset. Is there a faster way to do this or maybe a open source library that would work better? I'm only proficient in Swift currently :?
Thanks for any suggestions! This my first app and I'm very excited to hear your suggestions
I would look at UIPageViewController as its setup to do the scrolling by page for you, although you have control over what kind of animation it uses. You are responsible for feeding it view controllers to display using this method:
setViewControllers(_:direction:animated:completion:)
here is the link to the apple documentation UIPageViewController docs
I created a scrolling credits screen for one of my company's apps, FaceDancer, that would be a decent starting point for what you are after. The app is free. You can download it to check it out at this link: FaceDancer. The credits screen is off the info button on the main screen.
It's not hard to use UIView animations to simply animate a series of views. I think that might be easier than working with a scroll view.
I can give you some guidance if you think it would be helpful.

Best practice to have multiple tableviews in a single view controller

This question maybe already asked in stackoverflow. But, I did not get any clear idea to my scenario.
I have a viewcontroller (Say, MyViewController).
I have a scrollview(Say, MyScrollView) and I have N number of views (Say MyView1, MyView2, ...) in it.
Those views can be scrolled horizontally. Refer the below image for more clarification.
This image was taken from here.
So, the red area is the scroll view that holds multiple views which are yellow color.
Scenario:
I want to call API's for each view, when the API calling and parsing data occurs, I need to show some loading activity indicator in the views. After successful parsing, I need to update corresponding view with UITableView.
Questions:
In my case, the number of views may vary from 3 to 6. Should I maintain 6 separate UITableViews and UIActivityIndicator's?
I tried with three pointers like left, middle & right to hold reference of tableview and activity indicator. But the problem is, before the first three pages are loading, if the user goes to the fourth view, this system will collapse with so many conditions.
Suggestions needed. Confused!!
I think you have to use UIPageViewController with UITableView. it will solve your problem.

WatchKit – Two tables in two pages, second page has first couple of rows super-narrow

I have the following setup in my WatchKit app:
Two horizontal pages, which are configured programmatically via reloadRootControllersWithNames:contexts:
Each page contains a WKInterfaceTable which loads some separate data.
What I’m noticing is that the second page’s table has its content pushed down so that the first row in the right table is positioned somewhere in-between the second and third rows of the left table.
If I load a single table and a single page, everything is fine with either set of content, this issue only occurs when I have two pages, and both pages have a table – the second page has its table positioned low.
Both pages are using the same WKInterfaceController and pretty much identical logic (they’re just loading two sets of data), so I’m not sure why this might be happening.
It’s also worth noting that if I set up the two pages inside the storyboard and link them by dragging and using the “next page” segue, the problem still happens, so it’s not being caused by using reload.
This image shows mid-pan between the left and right page, and shows the gap on the right one (and that weird red stripe occurs twice, and my gut is telling me that it’s setting the width of my first two rows to like, 1 pixel or something).
Any idea what’s going on here?
I had the same problem. I was doing the table config in AwakeWithContent(). When I moved it to WillAppear() it worked fine. I think the problem is that as you are swiping to the scene it is trying to position the table.
WillAppear() seems to occur once the scene has slid in.

IPAD Block tap/touch on all other subviews of a View when one of them is being touched

So I have an ipad app under construction. I have a two big views, and out of them one has a dozen or so smaller views. These smaller views have buttons inside them. Whenever i touch the button in any of these views, the replica of the view gets added to the other bigger view. All this functionality works fine. Now what I would like to achieve is, I should be able to do that tap on only a single smaller view at any given point of time. That is I should not be able to tap on multiple views at the same time. Can anyone guide me through?
Thanks in advance.
Solved myself and with the help of #SmallVille in chat forums.

Resources