|
Hello, I can only figure out how to access the struct inside the class, not the variables inside the struct.
I would like to get the varibales inside the struct in the buttons The class:
The Struct:
|
|
|
|
I don't see in the code you've posted where |
|
|
|
It's the index into your array of |
|
@roosterboy So introduction in the variables struct would be 3 because i am getting a fatal error that says it is out of range. |
|
Your The Each item in an array has an index, starting at Once you have that item, you can then access its properties: So you essentially have this structure:
Clear? Okay, so let's say you want to show a
If you wanted to show the You are getting an out of index error when calling I would strongly suggest renaming your data structures and variables to make it clearer what things are and how they are to be used. So, for instance, It's also confusing when you have a class called |
SPONSORED Play is the first native iOS design tool created for designers and engineers. You can install Play for iOS and iPad today and sign up to check out the Beta of our macOS app with SwiftUI code export. We're also hiring engineers!
Sponsor Hacking with Swift and reach the world's largest Swift community!
This topic has been closed due to inactivity, so you can't reply. Please create a new topic if you need to.
All interactions here are governed by our code of conduct.
Link copied to your pasteboard.