Swift iOS app - issue with change storyboard segue kind - cant change from modally to show - ios

As you can see - i selected show but on main storyboard and in app it works like modaly.
What's wrong with it?
Even if i change to any other option, it works modally!
Edit: If i add button and segue to other view - it works always modally to even if i change this value.

For appearing with "Back" button in the navigation bar, you need to use Navigation Controller at first. In order to can push inside.
Check the image, Now it will be handled to push inside the stack of the view controllers of the navigation controller.

Related

Why does View Controller Shift in Storyboard on Button Segue

I am new to IOS App development and have a question. I'm trying to segue from one view controller to another. However, it seems that every time I ctrl+drag from the options button to the adjacent view controller and choose the 'show' option, the view controller "shifts" down(bottom picture). Why does that happen and if it is not the correct behavior, how can I do it right? Thanks!
You need to set fullscreen style manually if select model style,
a fullscreen option did not show in Push type, you must use Navigation Controller if you want to set fullscreen for Push
https://i.stack.imgur.com/rg20Y.png
When you click on the segue(the line that connects view controllers) and open the Attribute Inspector in right panel, you will see the Kind is set to Present Modally. This means your view controller will popup on your current screen.
You can change the Kind to Push and it will start showing normally.
Also embed your controller in a navigation Controller
Option 2
If you dont want a navigation controller, you can also change the presentation to full screen.
If you're new to iOS
then I might suggest don't use show and don't use segue from storyboard
If you don't know the concept of navigation controller (push and pop methods), then have a look at it (You may not use show afterwards)
have a look at following link
Swift programmatically navigate to another view controller/scene

Swift NavigationControllerBar Back Button

I am new in iOS development and in Swift. I have a question. I added in one of the ViewController NavigationController. But I have some problems with back button cause it doesn't appear on other Views. I tried with self.pushViewController() and with self.present() but it doesn't work. If I mark in NavigationController Is Initial View Controller then everything is fine but I don't want it because then app starts with this screen(where I have NavigationController).
Please help me, what I should to add or to write?
This is an image of my storyboard
And this is what I have if I run and go to another ViewController, as you can see I don't have navigation bar and back button.
You got 2 options :
1) Add a navigation controller in the root ViewController, Hide throughout except the last one. Make sure you push the last VC so Back option will be there by default
self.navigationController.pushToViewController(BarCodeViewController)
2) Use a custom View on top of last viewController add a custom button to that view. But this time present it from previous ViewController
self.present(BarCodeViewController)
when back button clicked dismiss it by adding target to the button. self.dismiss()

The back button in a navigation bar is shown in ios7/ios8 but not in ios9

The device runs ios8 and the back button is properly shown and I can use a swipe gesture on the device to navigate the view stack.
On the simulator (running ios9), the back button will not appear, and the swipe gesture does not work.
UPDATE: I have updated the device to use ios9, the back button vanished.
I have now found the source for this.
In the storyboard, the navigation controllers were cascaded.
The segue of the first controller stacked another full view controller, not just the view. On that view controller, the navigation was not properly initialized.
On ios7/ios8, this made no difference, the root-navigation controller's navigation bar was used. In ios9, it seems, that the navigation bar of the initial navigation controller is overwritten or it requires specific segues to the parent navigation view.
If the swipe feature is also dependent on the missing navigation bar initialisation, I have not tested. I have removed the superfluous navigation controllers and directed the segues directly to the views and now it works.

The TabBarItem disappear when I push in other view

I have a TabBarApplication with four views in the main TabBarItem. The problem comes when I go to any of these views and click in any button to go to another view and when I go back by a button linked to the main view, the TabBarItem of the app disappear!!
For example, one view of the app is a tableView in which each element of the list is linked to his external view and it has a back button that should return to the tableView. All the segues are by modal, not push because push segue crash the application and by modal it runs correctly but the problem comes when I returned by clicking the back button of the NavigationItem in the header of the view to his main view and the TabBarItem of the app is not there, is empty.
Each tab should have the view controller set to a navigation controller, with the view controller you want set as the root view controller of the navigation controller. Now you can use push segues and the standard back button that will be added for you. This will bypass the issue (and work much better for you and users).
You current issue is likely related to not really ever going back. Instead, just always presenting new modal view controllers which replace any existing content on screen.

ios storyboard tabbar > ViewController > TableView

I would like to create the following navigation
I have a tab bar program build with storyboard
and I have a View controller with buttons
when I click a button A navigation controller is called
Right now I have made all the connections and everything works fine but..
in order to create the change from the button to the table view I am using modal segue and that removes my tab bar.
I know that push will not work cause its not a navigation but how can I work this out?
I had the same problem but I realized that the best option is do it using a push segue. It's the best option because when you have a table view into a tab bar item it's more usability, it's what customer want. I'm sorry for not solution your problem but I strongly recomend you to use push.

Resources