Why can't I use the show segue in xcode 6.1? - ios

So I was doing a test for another swift project and I wanted to connect a TableViewController that had a NavigationController embedded in to a regular ViewController using a segue between a bar button item and the second ViewController. When I control-drag the button to the ViewController, I only get the following options:
From what I understand, I should see a long list of items including show and show detail. Even if I connect them with push or any other segue, I can't select show or show detail as the type of segue if I select the segue. What am I doing wrong? I have not made modifications to ViewController.swift. Thanks!

The new adaptive segue choices, "show", "show detail", and "present modally", and "popover presentation" are only available if you're using size classes. This makes sense because there's no need for the segue to be adaptive if you're not using size classes.

Related

How can I make UITabBarController respond to a single click for a tab?

I am trying to use UITabBarController in swift 4.2: https://developer.apple.com/documentation/uikit/uitabbarcontroller to navigate between 2 views, lets say ViewController1 and ViewController2 , each of these controllers being embedded in his own navigation controller. I am using swift 4.2 and deployment target is IOS 12.1. (Image with storyboard and controllers)
But it seems the default behavior is that to go to another tab you need 2 clicks(taps) as described also in Why i need to tap tabBarViewController item Twice to navigate to different View Controller - iOS
At first I thought it is something that I am doing wrong, but also trying the template provided by the IOS team for the tab bar it seems that the workflow is the same.
I created the UITabBarController from the storyboard. I also tried creating a custom tab bar class but did not manage to make it work. If I click once on ViewController2's tab, the viewDidLoad() and viewDidAppear() for ViewController2 are being called but the UI is not refreshed. After clicking anywhere in View or try to scroll the View is refreshed with the correct ViewController2.
Can you help me with this issue please? How can I make UITabBarController respond to a single click for a tab?

Xcode / Swift: How I implement a back button?

I just started with Xcode and Swift.
I try to build my first little App for iOS. But now I have the problem, that I don't know how to implement a the back button, so that i come back to the view before.
My Storyboard look like this:
When I open the A-Z view, I want to display the Back Arrow, which turn me back to the Item 2 view.
To open the A - Z view I connect the button "Medikamente A - Z" with the Navigation Controller.
When using storyboards the back button is usually implemented with unwind segue.
I usually like to follow raywenderlich toturials on UI related topics, like this - http://www.raywenderlich.com/113394/storyboards-tutorial-in-ios-9-part-2
It include a detailed example of how to implement back button in storyboards. Quoting from it -
Storyboards provide the ability to ‘go back’ with something called an unwind segue, which you’ll implement next.
There are three main steps:
1. Create an object for the user to select, usually a button.
2. Create an unwind method in the controller that you want to return to.
3. Hook up the method and the object in the storyboard.
When using UINavigationController, whenever you push to a new ViewController the back button will automatically appear, so you can jump back to the previous View Controller.
So it's works like:
UIViewController -> UIViewController -> UIViewController
A back button will appear on the last 2 so you can pop back the the previous ViewController.
You don't have to do any additional coding for the back button to appear, it'll do it on its own. I hope this clears it up. Let me know if you have any questions.
To implement a back button, your root view controller has to be a Navigation Controller.
The first view controller becomes the navigation root of the navigation controller.
If you want to present another view controller, you select a "Show Detail" relationship as the action for the button which should show the view controller. To do this, Ctrl-click and drag from the button to the destination view controller and select "Show Detail".
I had the same problem, even when on the storyboard the back button was visible at design time.
I deleted the segue, and recreated it with "Show" instead of "Show detail". Changing the segue to "Show" had no effect. I think this is a bug, so if you miss that back button delete and recreate the segue.

iOS 8 Navigation Bar Not Accessible in Second ViewController on Storyboard

I am new to iOS development and have not tried this programmatically yet. I would prefer to get this working in a storyboard.
I'm following this somewhat outdated tutorial from XCode 4.5 in XCode 6.1 to create a series of views connected by one navigation controller.
http://youtu.be/rgd6mCuzlEc
Once I create the second view controller, I am unable to double click the navigation bar to change the name and I am unable to add a bar button to it.
I have a Segue going from bar button "Item" from view 1 to 2. Notice in the "View Controller Scene" there is no navigation item. If I add any elements to the view controller they fall under "View" and not under "View Controller", unlike view controller 1 where it falls under "one".
Is this a limitation on XCode? Am I using the wrong Segue (Show)? Is there a hidden setting or customization I'm missing?
I actually have this working for 2 view controllers and failing the 3rd in a separate project but I don't know what I did to do that so I'm pretty sure it's possible I just cannot reproduce..
EDIT: Workaround Instead of the new adaptive SHOW segue, use the deprecated PUSH segue, add the bar button items, then change back to the adaptive SHOW segue.
Try adding a Navigation Item to the controller and it should work properly

Form Sheet of Modal Segue doesn't work with storyBoard

i am trying to present a view modally using the Model "Form Sheet". Surprisingly, all subviews that i add via storyboard are not shown , but when i try to create them using code (on viewDidload for example) these views are shown in the screen.
Also when i have changed the model to "Full Screen" the views are shown in this case too.
This is an iPad project being developed under iOS 8 version.
please can you give me you suggestion to resolve the issue.
EDIT
Here is some screenshots which shows how i made my transition using storyboard:
Thanks.
You can make use of Modal Segue in the storyboard and make sure that you embed the view controller in the navigation controller. And perform segue whenever you need to:
[self performSegueWithIdentifier:segueIdentifier sender:self];
Also make sure of the content size of the form sheet and place the sub views in correct position.

How To Make Ask View Controller iOS

I need to make "ask for something" view controller in my iOS application.
This is storyboard. When I click start button (customised button), I need to go to "second one table view controller", select there an item and pass that data that I selected back to "hidden one view controller". Which segue should I use in storyboard, and how should I pass data in code?
First of all you have to use a UINavigationController.
Drag it from your Object library and drop it in your storyboard.
It should present a UINavigationController and its rootViewController (a simple UIViewController). Delete the rootViewController and use ctrl + drag (as if you wanted to create a new segue) to make your controller the UINavigationController's root view.
You will have to do the same ctrl + drag to create a new segue from your first controller to the second one. but this time select push action segue.
If this is new for you, you should try this awesome course from Stanford:
https://itunes.apple.com/us/course/developing-ios-7-apps-for/id733644550
It covers everything you need to make your app on iOS. If you don't have time, at least watch the 11th lecture viedo 11. Table View and iPad.

Resources