We read every piece of feedback, and take your input very seriously.
To see all available qualifiers, see our documentation.
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
from my method
func collectionView(_ collectionView: UICollectionView, didSelectItemAt indexPath: IndexPath)
I can print the object like so
let object = self.datasource?.objects?[indexPath.item] print(object)
but if I want to access a property from my object, I can't. For instance,
print(object.imageUrl)
does not work.
How to go about this?
I've used the demo project to play with the library and the class I am trying to access is very similar to the Intermediate Example
struct MenuItem { let name: String let imageUrl: String let destination: String ``` ``` init(name: String, imageUrl: String, destination: String = "none"){ self.name = name self.imageUrl = imageUrl self.destination = destination.uppercased() } }` ```
The text was updated successfully, but these errors were encountered:
Well, this was pretty obvious but I had forgotten this since working with Genome.
I just had to cast it to my class
let object = self.datasource?.objects?[indexPath.item] as? MenuItem
Sorry, something went wrong.
No branches or pull requests
from my method
func collectionView(_ collectionView: UICollectionView, didSelectItemAt indexPath: IndexPath)
I can print the object like so
but if I want to access a property from my object, I can't. For instance,
print(object.imageUrl)
does not work.
How to go about this?
I've used the demo project to play with the library and the class I am trying to access is very similar to the Intermediate Example
The text was updated successfully, but these errors were encountered: