iOS Storyboards: Segues and More | raywenderlich.com

In this tutorial, you’ll learn how to connect view controllers to a storyboard, programmatically trigger segues, control visual components and respond to the user interactions.


This is a companion discussion topic for the original entry at https://www.raywenderlich.com/5055396-ios-storyboards-segues-and-more

Hi,

Thanks for the amazing tutorials. I got so much further with my project with your tutorials than with any others I have watched!

I am modifying your project to make it fit my own, but I have one difference that seems to be causing me problems. On your players scene, you have stars as images that rate the player. I only want one image but I can’t seem to make the adjustment. My code is below:

Screen Shot 2020-01-05 at 10.12.38 AM

The error in the screen shot is the one I can’t seem to fix. I would appreciate any help you can give!
Kathie

I couldn’t attach any more screen shots, so here is the rest of my code that pertains to this image.

struct Location {
var logo: UIImage?
var info: String?
var address: String?
}

… and …

static func generateLocationData() → [Location} {
return [
Location(logo: image Literal, info: “information”, address: “address”)
//other locations to follow
]
}

Hello @kquick,
I’m delighted to know this tutorial helped you out a lot :]

From the screenshot I can’t spot a problem but I have a feeling that this is one of the cases xcode is just showing an error but not where the problem actually is.
Any chance I can see the project? ( I mainly need to see the file where Location class is defined.

Note: I’m assuming that the static function you wrote above has a typo the brackets:
→ [Location} should be → [Location] (notice the closing bracket) but I suppose its just a typo

I noticed the typo as soon as I sent it off to you!! I do have a bracket in my actual code.

Can I email my project to you? Thanks for being willing to help.

Sure :] I sent you my email in a message.

Dear Ehab,

Thank you for a great article! It was a brilliant way to explore segues and having a variety of different view controllers.

One question - how can you change the star rating of a new player? I don’t seem to have the functionality for that. Did I miss something; if not, could this be coded in so that the star rating is chosen for a new player?

Many thanks and much appreciated,

Josh

Hello Josh,
Its a pleasure to know you liked the article, its always good to hear positive feedback :]

The rating value is currently not set for new players, you didn’t miss anything. And I didn’t go through that to keep the article short(er) and focused.

in PlayerDetailsViewController.prepare(for:sender:) you can see the rating is always sent with a value of 1. You can build the UI you need to have an initial rating value in PlayerDetailsViewController and then pass the value selected instead of the hardcoded value there.

Dear Ehab,

Many thanks for the speedy reply! Glad to know that it wasn’t something I missed - I will check out how to add that in.

Best wishes,

Josh

This tutorial is more than six months old so questions are no longer supported at the moment for it. Thank you!