UINavigationController Back Button position - iphone

Ist it possible to set the back button of UINavigationController to the right side programatically?

You could create a custom button and place in on the right hand side. You could assign an action to the button which performs your going back functionality.
The problem with this is that your back button wouldn't have the look and feel of the traditional back button that users have come to expect, and your app may be rejected for going against this very common user interface design.

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.

Unwind from UIViewController by swiping

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).

UINavigationButton & UIButton on PopToRootViewController?

My app has a sign in button and a sign up button, which are UINavigationButtons and UIButtons respectively. Either segues to a new screen that, on success, should PopToRootViewController; However, when I successfully sign in, my sign in and sign up buttons are still present. I have a method that decides whether or not to display the buttons that gets called in the viewDidLoad method. Thus, when I stop/run the app again, the buttons disappear as they should. Can anyone give me advise on how to get these buttons to hide? Thank you.
Bonus points: I also have a log out button that has a similar issue; I have to re-run the app before my view controller realizes it should hide the logout button and show the sign in/up buttons.
The problem is that viewDidLoad is only called once, so it is hardly suitable for this purpose; it has to do with the view coming into existence, and nothing to do with the interface. Use viewWillAppear: and make the decision about whether to show or hide the buttons on the basis of, say some info you've stored in NSUserDefaults (like, has the user signed in or not).

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.

How can we disable the button in my iphone app?

In my application, there is one button in the navigation bar. I want it to work only for the 1t click of the user. If he continousally presses on it 2 or 3 times just after the 1st click the button shouldnt recieve the following ones. How can I do this?
My app always crashes if the user presses it for more than once. I dont want to make it multithread and use lock. Thats why i want to know whether there is anyother alternative.
(If the app crashes by pressing more than once then there's a bigger problem.)
Since the button is on the navigation bar, that's a UIBarButtonItem, not a UIButton. The UIBarButtonItem has an enabled property which you can set to NO to disable the button.
(If it is really a UIButton, don't worry, it also has an enabled property.)
After the user clicked the button, you could set the "enabled" property to NO and after the action finished, set it back to YES
http://developer.apple.com/iphone/library/documentation/UIKit/Reference/UIControl_Class/Reference/Reference.html#//apple_ref/occ/instp/UIControl/enabled
Luckily this is pretty easy to do. The UIBarItem class has an enabled property. Just set it to NO once the user taps it.