button on navigation bar is invisible but clickable - ios

I have a button that has a custom view that I share between several view controllers for a rightbarbutton item on the navigationitem. Sometimes the button doesn't appear, but is clickable. This button is created programmatically (not in IB).
In one case where I pop the view controller that it is invisible on (by clicking the back button) and then push it again (by putting the button that creates it), then the button shows up again.

Related

How to present another view controller under tab bar on button press inside a tab bar controller view?

I have 4 tabs and in the home tab, I have a button to goto profile view controller.
When I use segue, The view changes completely and it's presented over tab bar. So it gets hidden.
I want to present it under the tab bar so that I can quickly navigate to other tabs without a back button.
I am not sure if this is the right way or not. but you can add presenting viewcontroller's view as subview with the same animation.

Swift - create a back button without navigation controller

I have an app that has a toolbar, but I don't want the bar at the top, in order to free more viewing space. Therefore I have decided not to use a navigation controller. I'd like to add a back button to the toolbar. How would I go about this?
Adding the button is easy enough, and setting the action to performSegueWithIdentifier is all fine, but what happens is that the previous view just gets loaded again, rather than show it as it was, like a true back button. So if I tap on the 10th row on a tableView and go to a new page, when I press the back button it loads the view from the top again, instead of showing it as where I scrolled down to last.
Even though you don't want a UINavigationBar, you do want a UINavigationController in this case, because it manages the 'back stack' exactly the way you want it. Just hide its navigation bar by setting its navigationBarHidden property to true (in the Storyboard or in the viewDidLoad function of the root view controller).
You can then use navigationController.popViewController(true) as normal, in response to the user clicking your custom back button.

Override navigation controller back button

I have a UIViewController called detailViewController that I push to from homeViewController.
In detailViewController there is a container that will display subview A, B and C.
If I tap the back button in the navigation bar, the navigation pops to homeViewController, as expected. I'd like to override the back button so that if the container is displaying subview B, the container updates to show subview A (and likewise, subview C goes to subview B). And if we're displaying subview A then pop back to homeViewController as expected.
Essentially, I need to be able to tap the back button but force the navigation to not pop to the previous view. Is that possible?
I know I could hide the back button and replace it with a custom bar button item but I don't want to do that. I want to keep the exact styling of the native back button.

Create Modal View with Save/Cancel button

I'm pretty new to Xcode development (I'm using swift), and am building up my application flow in the storyboard. I'm attempting to create an "Add New" dialog in a similar style to that on the Calendar app.
In terms of structure, I have a UITableViewController that has a UINavigationItem on it (There is a UINavigationController before it in the storyboard. I have added a UIBarButtonItem with the Add Identifier, and created a Segue from it to a new UIViewController, using the "Present Modally" option to make the view appear in from the bottom.
On the "Add New" screen, I want to have a Navigation Bar at the top, with a Cancel Button, a Save Button and the page title (the same way the Calendar App Add Event view works).
Initially I figured I would just throw a UIToolBar item onto the page and create those items by hand. However, the apple standards seem to indicate that Toolbars should only ever appear at the bottom of the screen, not the top.
I can change the Segue to "Show", this causes the view to slide in from the right. It also sets the left hand button to a "Back" action (i.e. "
What is the apple-approved structure I should be using to do this? To summarise, I want to do the following:
Segue from the Add button on the List View to the Add View.
Animate the Add View in from the bottom
Display a Navigation Bar on the Add View containing three items:
Cancel (Far Left) - Returns to the Previous View (by sliding the view down)
Title (Middle)
Save (Far Right) - Performs a custom action (I can handle this myself)
You should present the "Add New" dialog inside another UINavigationController, even if you don't intent to push additional view controllers onto it once it is presented. This allows you to easily use navigation items again to show the buttons.

iOS7 How can I step aside from Navigation Control?

Brief Explanation:
View 1(Navigation Controlled) has a "add new object" button A.
When click button A, it will move to View 2 (Navigation controlled and has back to view 1 button on the top with "< View 1")
View 2 has a "Save object" button B, which I will add a new object into View 1's NSMutableArray.
However, when I click button B, it will go to View 1 with "< View 2" back button on the top of navigation bar even though it's the root navigation view.
On storyboard, button A and B action is as push.
Question
How can I get out of this navigation movement?
Is there a way I can direct to button B action to a certain view? Without navigation back bar automatically added on top?
The action for button B shouldn't be a push since you want to go back to the first controller. When you want to go back to the previous controller, you either should use the default back button in the navigation bar, or if you have a custom button, you should have popViewControllerAnimated: as its action.

Resources