Search code examples
iosswiftxcodeuikit

iOS: Segue issue while following Apple's tutorial


I'm following the "personality quiz" guided project from Apple's book "App development with Swift".

The guide had me create several view controllers and a bunch of labels and a buttons so far. Then it came to creating segues. TLDR of the instructions is:

Control-drag from the button in the first VC to the the second VC and create a show segue. Control-drag from the VC icon above the second VC to the third VC and create a show segue. Embed the second VC in a Navigation Controller. Create a modal segue from the first VC's button to the Navigation Controller.

Now, here

Here

is the result as shown in the book (last VC missing from in the frame)

This

on the other hand is what I ended up with.

What could be the problem? Thank you.

EDIT: Yes, I am using Xcode 11 while the guide shows Xcode 10. To further explain my actual problem - If I understand it correctly, I ended up with a "modal presentation" while the book wants to have a "right to left push".


Solution

  • The screenshot from the tutorial is not taken in Xcode 11 (Probably Xcode 10). You seem to be using Xcode 11, which shows the VCs as if they are in iOS 13. Xcode 10 shows them in iOS 12, so of course they are going to look different.

    Don't worry if your actual result doesn't exactly match the result shown in the tutorial, unless it doesn't actually work. If it's just aesthetic differences like this, it is very normal because the tutorial is using a different version of Xcode. The important thing here is that your first VC should present a second VC that is a UINavigationController. If you run the app and it does present it, then it's working correctly. iOS 13 just presents it a little differently than iOS 12.

    If you want to achieve the full-screen VC look, select the segue between the first VC and the navigation controller, and change "Kind" to "Present Modally" and "Presentation" to "Full Screen".