Unwind from UIViewController by swiping - swift

Unfortunately I didn't know what keywords I should search for about this topic. I wanted to know how you could program going back from a push segue not by pressing any button but by swiping from the left border of the phone such you could do in many programs such as WhatsApp.
I thought about using UISwipeGestureRecognizer but I didn't know how to do that.
Thanks for any help :)

As Joey said, if you're using a standard UINavigationController on iOS 7 or later, this functionality should be built in. However, if you should need this behavior outside of a normal navigation action, the UIScreenEdgePanGestureRecognizer would be what you're looking for.

If you perform the usual Push segue - either via Interface Builder or via performSegueWithIdentifier, you get this behavior for free so long as the app is running on iOS 7+. Any time you can navigate back from a push segue you can either tap the back button or swipe from the left edge. Nothing special is required to obtain that behavior, unless you're not using the Push segue (for example, a modal segue).

Related

UIDocumentBrowserViewController handling back navigation

Apple states that the UIDocumentBrowserViewController should be the rootviewcontroller of your app.
https://developer.apple.com/documentation/uikit/view_controllers/adding_a_document_browser_to_your_app
I have done it this way but I have some UX problem that I cant tackle.
I cant find a good UX solution for navigating back into my App (switching back the app windows rootviewcontroller again to whatever I want).
However I have found that there are some properties where I can manipulate the appearance of the control, "Use the additionalLeadingNavigationBarButtonItems and additionalTrailingNavigationBarButtonItems methods to add buttons to the navigation bar.", but these wont add items to the "main" menu (where I can select other FileProviders, drive dropbox etc.) and where the possibility of going back would be the most clear.
Does anyone implemented, knows a good solution for adding a back button, FAB, back swipe gesture, or something for UIDocumentBrowserViewcontroller which is presented in a as the apps rootviewcontroller?
Im looking for a solution when the user ended the browsing of documents in the UIDocumentBrowserViewcontroller(copy,import etc) and wants to go back to another Viewcontroller.

Storyboards multiple buttons cause same segue

I'm working on trying to figure out storyboards and it all seems pretty cool but I'm having problems with moving from one screen with a few buttons to another screen no matter which button is pressed. Obviously I can control drag from each button but then I have segues all over the place on the story board and I feel like there has to be a better way to do it. I've tried highlighting all the buttons and control-dragging to the next screen but that only caused the one I dragged from to work.
Here's an illustration of what I have that works right now...
If I have to stick with this then so be it but I'm going to end up with 6 buttons on one page and 8 on another. That's alot of segues. Basically each button signifies a choice for the user. That choice will cause different things to happen behind the scenes but no matter which button they choose they move to the next screen.
What I've Tried:
Highlighting all the buttons and then dragging to the next view controller.
This failed because it only connected the segue to the button I clicked on when I control-dragged
Dragging out one segue then dragging from the second button to the circle part of the segue.
This caused nothing at all to happen.
I'm unaware of a way to give a single segue multiple triggers in a storyboard, however you could create a single segue with a particular identifier, and then have all of the buttons respond to a single IBAction that calls [self performSegueWithIdentifier:...];
Check out generic segues, which are tied to the source view controller instead of an IBAction:
https://stackoverflow.com/a/8868096/295130

iPhone view with pop up animation?

I'm new to iPhone development, its going OK so far, I've managed to get to grips with the Tab bar, navigation bar and tableviews.
However I want to be able to copy what the settings app does on the device when a user wants to change language.
In Settings, General, International when a user clicks on Language a new screen animates over the previous screen with a navigation bar that has a cancel and done button and a table view showing the languages available for selection.
I cant seem to find how to do this via Google so I was wondering if someone could point me in the right direction of a tutorial or what I should be searching for? Is it type of view or a certain way to animate a view?
This is done via a method available on UIViewController (and thus all of its derivatives as well) called - presentModalViewController:animated:. You simply need to create a new view controller that you want to display and pass it into that.
See the link to the UIViewController docs above for more info and the complementary method - dismissModalViewControllerAnimated: to close the view. The docs have links to example code on how to use them as well.
in iPhone, it's done through modal view controller. Refer this tutorial.

Navigationcontrol in iphone

I am trying to develop an application for iphone 3G which requires flip from one page to another page.I can navigate from one page to another page by using navigation control but it gives the animation from "right" to "left" when page changes. Can i flip it in just opposite direction means the page will animate from "left" to "right" when requires to go back to previous page? the animation effect must be there.the application is navigation based not view based.And the back flip action must be in a button not in navigation bar button.
I think it can be done as we can do it by navigation bar button,but got to put that logic in normal button. pretty confused about the logic...
Can you please help me?
I just wrote an answer to another similar question which may be of help:
Push Next Detail UIView without going back to parent UITableView
You can use -[UINavigationController popViewControllerAnimated:] to reproduce the effect of the built-in "Back" button. Or there's -[UINavigationController popToViewController:animated:] if you want to go further back than one view controller.
For going from one view to another you can use [UINavigationController popViewControllerAnimated:YES] and when you u want to go to previous view you can do is write teh following line on button click event [UINavigationController popToViewController:animated:YES] and hide your back button in the navigation bar item as per your requirement.

What is the picker pattern used in the iphone calendar app? NOT a UIPickerView question

Sorry another newbie question that I couldn't seem to find an answer to on google. Guess I don't know how to describe it well enough.
On the calendar app for the iphone, when you go to add an event, if you select from the repeat, invitees, alert sections and so forth, you are brought to a screen with some choices for the field.
Is this simply navigating to a new view controller on the tap which displays these choices, or is there an pattern that you can implement for this out of the box?
It's just a garden-variety UITableViewController that's pushed onto the navigation controller's stack.
It's probably passed either a reference to the event object or a delegate it can send a message to to set the selected value when "Done" is tapped.