Dragging items while in a UIPageViewController - swift

I have put together a set of pages using UIPageViewController. The first screen is an initial screen, and the user should swipe to the next page after being greeted. The following three screens are tabbed views.
Once the first of these screens loads, I no longer need the ability to swipe from view to view. Instead, I have a set of tabs at the top of the screen to navigate between each page. Upon clicking a tab, the screen scrolls to the next page.
basic workflow diagram
Two of the three pages have dragging abilities. On the first, the user will drag small UIImageViews to a destination. On the second, the user will interact with a chart using touch.
My questions are:
Is there a way to keep UIPageViewController from moving given a particular index?
I like the way the tab view scrolls from page to page, just on the last three pages I don't want "side to side" movement. Only when the user clicks a button or tab at the top. Is this possible?
Would you consider this a good way to implement this sort of UI? I am still relatively new to using Swift/IOS, would UIPageViewController be the best fit for this? If not, what might be a better approach?

After a little digging I found this post:
How do I Disable the swipe gesture of UIPageViewController?
It would appear that disabling the dataSource protocol is what I needed. On the introductory page, I created a swipe behavior to load the next page.

Related

iPhone transition effect to reveal an updated version of the same view

So I have an app on the main page is details of the current date.
The page has left and right buttons to move to previous and next dates and a table of info below. This all works.
However I want to add a swipe between the days, now doing the swipe control is easy and I have done that.
However I want to give the visual indication of a swipe.
I am not changes views , I am simply refreshing the current view.
If you look at myfitnesspal (free app) , that swipes between dates in the same way I am after.
It scrolls off (a copy?) of the screen to one side , slides in the latest version to replace it.
I am at a loss on how to achieve such a simple effect without going for multiple views which unless I am misunderstanding would be over complex.
Use a UIPageControl, here is a tutorial of how to implement one using only two views: Cocoa with Love UIPageControl sample
Both views can be identical, (instances of the same Class, created programmatically or 2 CustomView outlets on IB)
This way you only need to update the view that's going to slide in the screen.

Using UIPage Control

I have been trying to build a app where you touch three different buttons and then go to there new view. Its it possible to use a UIPage Control? If so How would you go about doing that. For example I have three views. Apple, Orange, Cherry. I would like the user to flick between these three views. I need them to be three separate views i can't just have the image change.
How would I go about using the UIPage Control and switching views?
UIPageControl doesn't deal with switching views itself, it just provides the dots that are typically displayed at the bottom of a paged view and it can be tapped to go one page forward or backward (instead of swiping the actual view). The actual view that displays the content is typically a UIScrollView with pagingEnabled set to YES.
When the control is tapped, it sends the UIControlEventValueChanged event to its target. You'll then have to scroll the UIScrollView to the right page yourself.

Can my custom tabbar be created like so for iPhone?

I have designed a custom tabbar and the developer says the design I created can't be done.
The screen is made up of a usual background with a tabbar. I'd like my tabbar to look a little different to the usual iPhone style. I would like at the bottom of the tabbar a grass illustration (transparent) and on top would sit all the separate buttons and on top of those would be the icons. All of these images (as seen in link below) are separate .png files.
When the user scrolls the content, it will scroll under the transparent grass. The buttons of course will be clickable and have a different view for an active state.
Please see the link below to see a mock-up of the image:
http://www.stuartkidd.com/dummy.jpg
I'd appreciate if the community could explain to me if this could be done and if so, how. I thought it would have something to do with 'creating a custom tabbar'.
And a further question, if it can be done, can also the tab buttons be horizontally
scrollable with a swipe action?
Thanks,
It all can be done but you are going against the Iphone UI guidelines. You won't be able to leverage the UITabbarView to do what you want so you'll basically have to write the whole thing from scratch. Your tab bar would be a scroll view with a row of buttons representing each tab. When a button is clicked you load in the appropriate view. The UITabBar controller gives you a lot of functionality for free and I suspect once you start working towards this you'll see exactly how much extra work this will end up costing you. Going against the way Apple does things can be a slippery slope.
Another idea might be to keep a hidden UITabBar to manage the tabs and call it from your custom tab bar. This would free you from a lot of the hassle of swapping views/controllers in and out.
You can create a row of custom buttons and have 2 subviews. One for the bottom navigation bar and one for the content view where you will be swapping your content based on what is pressed.
You can have a state which maintains what was clicked. Based on that you can set the button enabled state for every button in your bottom bar.
button.selected = YES
It will be easy to handle the touch up inside events and properly load appropriate views in and out of the bigger subview as they will be part of the same view controller.
I have implemented a similar functionality and it works well but still in process of submitting it to the app-store.

displaying first ten contact in one page and other in second page

I have requirement and I am not configuring out what to do for displaying first 10 contacts in the first page(table view), after 10th contact, it should display remaining 10 contact in second page(table view).
It should also display toolbar as soon 11th contact is added in table view showing the "Next" and "Previous" .
Please let me know from where I should start?
Any tutorial or reference is appriciated
Pagination is nothing else than going through pages, just like you described.
If you want to use pagination show only as many entries as will fit on the screen, so the user always sees everything and doesn't need to scroll. You could still use a tableView and disable the scrolling though I still think a tableView is a very good way to show large amounts of data.
To navigate through your data some of these three approaches may give you an idea:
Buttons in a UIToolbar to go forth and back
UISegmentedControl in a UIToolbar
UIPageControl at the bottom, whole content is in a UIScrollView, user can swipe to go through pages

iphone search swiping

I am wanting to have half of a view taken up by a page control. The page control will allow the user to swipe from left to right on a selection of 5 different table view lists.
Is this possible?
What is the best approach.
Will each table view that will be put into the page control need its own controller? Or am i totally off the path.
The example i want it flow like is the screenshots of apps in the app store app details page. Except for screenshots i will be showing lists of data.
Thanks in advance
It sure is possible. Use a scroll view with paging enabled.
And you dont need to have separate controllers for each table view. You can handle multiple tables in a single TableViewDelegate, as all the delegate methods have the table view a parameter.
Check PageControl and ScrollViewSuit code samples.
And about covering half the view, well, your scroll view can be any size.