Welcome to the Treehouse Community

Want to collaborate on code errors? Have bugs you need feedback on? Looking for an extra set of eyes on your latest project? Get support with fellow developers, designers, and programmers of all backgrounds and skill levels here with the Treehouse Community! While you're at it, check out some resources Treehouse students have shared here.

Looking to learn something new?

Treehouse offers a seven day free trial for new students. Get access to thousands of hours of content and join thousands of Treehouse students and alumni in the community today.

Start your free trial

iOS

PrepareforSegue to a UIView

Hey,

I have a UIView in a view controller which displays an image. This UIView is associated to classX, while the view controller it is in is associated to classY.

My question is, how can I use prepareForSegue in the case? I want to send data to the UIView class to display an image depending on the value it receives respectively.

I have it this way because in classX I need to inherit the UIView class to display the pictures, while in classY I need to inherit the UIViewController because i have functions that need it there; from my knowledge, I cannot inherit both together.

Any thoughts?

Thank You Yousef