NavigationBar Right Button Problem - iphone

I have a navigation bar in my app. The below pictures are in the order of navigation.
Problem I have is, on clicking the "Main" button , I am able to perform the action and goto the required screen , but the navigation bar does not look like the first on (with Menu as left button). Instead it look like 4th image. How to make it look like first image so that I can make the user to navigate to "Menu" screen by clicking menu button ?. Thanks for the help …!!!

If I'm understanding this correctly, you may have pushed the first view controller (The one from screenshot 1) when clicking on main which is why you see "lens" in the back button. That back button takes the title of the previous view controller in the stack. What you want to do is pop to the first view controller when they click on Main using either popToRootViewController or popToViewController:animated

Related

Swift 4: Click button to next View Controller but the new page's animation is "cover vertically" instead of "shifting" to next page

I am newbie of Swift 4 and I am trying to simply click a button and go to next page.
So I add a button in the first page and another view controller. Then I drag the button to the next page to create the "transaction". However, the animation of the transaction to pop up the next page from bottom, as shown in the image below. What I expect is to shift horizontally from current page to next page. Where did I do wrong? How can I achieve this?
Select the first view controller and choose Editor > Embed In > Navigation Controller. Make sure your segue is Show (Push).

Swift: Pop from one tab to another tab

Have a tabBar Application in which there are five tabs and in one tab have added back button and i want to pop back using back button. how can it be done? have tried below code and it doesn't work
self.navigationController?.popToRootViewControllerAnimated(true)

Won't add navigation item to navigation bar in xcode

I'm trying to create a back button on my navigation bar in x code. However when I drag it across from the objects library to the navigation bar in the storyboard it doesn't come up.
OK So this is crazy but...
Click on the navigation bar and in the attributes inspector, Just Type something in the field marked Back Button. Then in the scene hierarchy you'll see the button, though it won't yet appear on your navbar. In the hierarchy, drag the button onto the Navigation Item and viola it appears. Now to make second one, hold option and copy the first one. If you try to add one from the object browser, you'll lose the first one.
If done properly, the first will show up on the right and the second on the left.
Good luck.
This happens when the navigation is not set up correctly, as dbajkovic mentioned, if you do not have a navigationcontroller, it will not work. Your scoreboard should look like this:
You can not add the button to the left, only to the right.
#Jonathan Thompson: I came across your post and since I just learnt something new, I am going to add it as a response to your question.
There are two separate buttons - Back button and Bar Button. Back button has a reverse (right to left) pointing arrow and a Bar button is a regular rectangular button. The following describes how your could implement them in your program:
Back button:
On the root view controller, ctrl + click on button and drag it to the view controller you are trying to connect it to. When you are given an option to select from, choose Push, not modal. This will automatically add a back button on the next view controller. (Run the program to confirm it.)
Bar Button: (Credit: dbrajkovic)
For adding the bar button, click on navigation bar of the navigationViewController you are interested in. Under Attributes inspector, type some name in Back Button and hit enter to confirm. Open document outline and locate the viewController you were working on. On the left side of Navigation Item locate the disclosure triangle. Click on the Bar Button Item. Ctrl + click + drag the button to the navigation bar of that viewController. You can choose whether to place it on the left / right side.

How do I reset UIScrollView to Zeroth Page/Index when Clicking on a Tab Bar Item?

I have a tab bar application with 3 tabs. The first tab loads a UIImageView that is nested within a paginated ScrollView. If the user were to scroll through the pages for a bit, then click on another tab, and then click back to the first tab, they would return to the last page they scrolled to within the ScrollView.
How can I have make my first tab bar item resets to the initial image/page in my UIImageView every time it's clicked?
Thanks!
Have a look at :
UITabBarControllerDelegate. You have a callback didSelectViewController.
One solution would be for your ApplicationDelegate to get this callback and inform your firstviewcontroller from the first tab to call a method that would just take the user to the first page.

How can I dismiss the view appeared by touching Add item in UINavigationController?

I have added add(+ symbol button) button to my navigation controller.
When I click it a view appears from bottom. I added a navigation bar and two buttons to it.
One save and one cancel button. And the view have one textEdit box. After editing I can save or cancel. If I touch cancel I need the view to disappear like it should go down again.
I think all iPhone , iPodTouch users use it. Like when they touch Add item then a view appears from bottom and when they cancel it goes down again. How can I make in this way in my application.
Maybe you're talking about a UIActionSheet?!?
http://developer.apple.com/IPhone/library/documentation/UIKit/Reference/UIActionSheet_Class/Reference/Reference.html