How to swipe and move a UIViewController - ios

I am trying to implement swiping a UIViewController's view up and down. This would be similar to Facebook Paper (swiping down to reveal search, post and other controls), or any other app that gives the user full control of moving the view with their finger.
Does anyone know how to do this efficiently?

The simplest solution is to manage your individual view controllers with a UIPageViewController, described this way on the class reference page:
A page view controller lets the user navigate between pages of
content, where each page is managed by its own view controller object.
Navigation can be controlled programmatically by your app or directly
by the user using gestures. When navigating from page to page, the
page view controller uses the transition that you specify to animate
the change.
You can specify UIPageViewControllerNavigationOrientationVertical as the orientation if you want the pages to move vertically, and you can also specify the gestures and animations used to transition from one view controller to the next.

I ended up finding that menus like this one are what I am looking for.
Though, they aren't recommended by Apple. See WWDC 2014 Videos, Designing Intuitive User Experiences.

Related

Displaying user information on an popover alert view controller

I am working on an app for a Cafe where users can "sign in" to their seats.
Currently I am thinking of a way to present basic user information of seated people. What I am envisioning is to when the table gets tap, a square information box (pardon my primitive language) appears in the middle with the background being blurred out. I am hoping to have something flexible so that i can add tab and such to this so called box.
I have been looking at popover alert controllers and apparently there is limited information on them in regards to the iPhone. Is there a reason why popover view is not used for iPhones as compared to iPads? Moreover, is there a smarter UI to handle this or should i just segue to the next view when tapped.
Basically, popovers are iPad-only because iPhone screens are too small to make them effective. UIAlertController is a similar alternative, though it may not lend itself to what you're trying to accomplish.
Segueing to a new view for the user information is definitely a solid option, or if you want to preserve the feeling of staying on the same view you can animate a custom view over top of your current view, often from the bottom in the style of a keyboard or the settings drawer.
I think you are mixing up two different concepts: Alerts vs View Controllers being displayed modally.
Alerts – as the name suggests – are used to bring something important to the attention of the user. They usually interupt the current flow.
View Controllers presented modally are similar to what you discribe: a new View Controller moves over the current one, and the current one is blacked out to put emphasis to the new one. As you rightly pointed out though, this is hardly used on iPhone: This is because iPhones historically have rather small screens, and scaling down a view controller leaves hardly any room for content.
View Controllers presented as popovers is yet another thing: Here, you show the new view controller in a separate window that originates from a specific point in your UI.
This document might be of interest for you.
You may want to use a Modally presented View Controller. For this, you will create the view you want to pop up in a separate view controller. Then, control-drag in a segue from the parent view to the Modal of type Present Modally. You can even get your blurriness by setting your Modal's background to clear and adding a Visual Effect with Blur to its view.
Now, give the segue an identifier in the right hand pane so you can call it programatically.

Apple Watch App - Mix approach of Page based application and Hierarchical application

Is there any way to add horizontal scrolling/pages inside Hierarchical WatchKit App. OR navigate to controllers inside Page-based application. (Hybrid approach of hierarchical and page based application)
I want to show screens in horizontal paging, however use can navigate inside further screens/controllers from any page.
As we can not push any controller in page based application, nor we can show horizontal pages in hierarchical WatchKit app. Is there any way to use hybrid approach?
My target is to show horizontal paging to user at start of application and user can navigate into hierarchy of any page.
P.S: I've implemented hierarchical and page-based applications separately, looking for some hybrid solution. One option is to make page-based application, and present a hierarchical interface modally. but there is limitation that i can not navigate further. (let's assume there are 10 pages, and in each page user can navigate upto 3 levels hierarchy)
Any suggestion would be appreciated.
Thanks.
According to WWDC 2015 Session Videos, it is not good to make such a hybrid interface.
Imagine you have a hierarchical one with two buttons. Clicking on first button opens up a view containing Page-based navigation. This will work, but if you want to scroll between pages from this page to previous one, this gesture is like returning back to Hierarchical view (scrolling from left side), so we will have a disorganization here.
In other hand, if you include buttons in a Page view controller, then user will expect to return to the only first page when returning back all the way. When he returns back to the first page, again he may thinks I must return again and so there will be another disorganization here between returning back all the way and scrolling toward the page.
If you need to implement this feature in your app, you can make a Page View navigation by dragging views to each other while pressing control key, and then add buttons. Control-drag buttons to the destination view controllers, or you can implement a hierarchical one and then control-drag the destinations together.
See WWDC 2015 session videos to get more about that. They can be found in developer.apple.com/wwdc.

what do I need to use to change controller when sliding left?

I want to create a touch control, where I slide left and the view scrolls in a paged mode (like in Photos app where you slide between photos) but instead of a view in a current controller coming in, I want a new controller to come in with it's own view. What control should I use to build something like that?
You can use UIPageViewController to navigate between different ViewController like a scrollView
You can follow this tutorial
1-http://www.appcoda.com/uipageviewcontroller-storyboard-tutorial/
2-http://www.appcoda.com/uipageviewcontroller-tutorial-intro/
3-http://www.makemegeek.com/uipageviewcontroller-example-ios/
hope it will help you

master controller with buttons needs to load pageviewcontroller. master buttons not accessible after first load

I am new to xcode and IOS (and this board. First post).
I am completely flummoxed by a design problem and unsure how to approach.
I have three buttons, each of which calls a new array of pages that need to navigate horizontally with swipe gestures and have their own buttons.
The three buttons in the parent work exactly like a tab bar except they have to be bigger and higher than a tab bar would be. The called page arrays mostly work like a pageviewcontroller except that the pages need to have a button/indicator below to allow non sequential navigation. The target HAS TO LOAD WITH A SEGUE.
The problem I'm encountering is that using a modal segue to load a pageviewcontroller and prepareForSegue to keep the master/parent view controller visible results in my buttons being inaccessible. I assume its because I cant click thought the child view controller.
Secondly, I don't know if its possible to customize the page indicator dots of a pageviewcontroller so they can look like a bar with graphics.
Here are my specific questions:
Is it possible to load a view controller with a modal segue and still access my buttons? Can the child be resized?
can i customize the buttons/indicators in a pageviewcontroller. Can you point me to some code?
should navigation like this be done with some completely different approach? What about a view controller container?
Here's a diagram (cant post images directly yet)
I've found the answer to my second question: It seems that pageViewController's indicators are not customizable in any way. This rules out pageViewController for what I need.
9 Views in 10 hours. Is this not the best forum for questions like this or is there something wrong with my post?

iOS - Keep background animation across view controllers

I'm using a basic UINavigationController design for the settings pages of an app. Each settings page is its own view controller (with xib), and each page has the same background image.
I've since built a view-based animation to replace the background image, and I'd like it to play uninterrupted while the user moves from page to page. In other words, it's as though each settings page had a transparent background, and beneath all of them was a single instance of my animating view.
How would I go about doing this?
So far, I've tried just putting the animation on each page separately, but the transitions look a bit too sloppy for me. I'd also considered somehow having a single UIView with all necessary animations underneath my navigation controller, but not sure a) if that's feasible, and b) how to go about that.
Thanks for reading.
Sounds like you want to be using "Container View Controllers"
You can read up on the Apple documentation here: https://developer.apple.com/library/ios/featuredarticles/ViewControllerPGforiPhoneOS/CreatingCustomContainerViewControllers/CreatingCustomContainerViewControllers.html
The solution would be to have one master view controller which holds onto your settings view controllers. The settings view controllers background is transparent so you see the background of the master view controller.
As for the animation see Listing 14-3 Transitioning between two view controllers on the link I provided you.

Resources