Welcome to the Treehouse Community

The Treehouse Community is a meeting place for developers, designers, and programmers of all backgrounds and skill levels to get support. Collaborate here on code errors or bugs that you need feedback on, or asking for an extra set of eyes on your latest project. Join thousands of Treehouse students and alumni in the community today. (Note: Only Treehouse students can comment or ask questions, but non-students are welcome to browse our conversations.)

Looking to learn something new?

Treehouse offers a seven day free trial for new students. Get access to thousands of hours of content and a supportive community. Start your free trial today.


Design pattern with Custom Views

I need the help of an experienced app coder. I am designing an app which is similar to the Playlist Browser application.

It has a main screen that has a list of different Names. Once you select a name, the app then has to show another screen with either one or two UIImageViews depending on the name you selected.

For example: Let's say on the first there are two option: Jokes and Thoughts. If you select Jokes, it takes you to a page which has two images one says Tap for Dad Jokes other one says Tap for non dad jokes.

But let's say you select Thoughts on the main page, then you are taken to another screen which only has one image in the center that says "Tap for a random Quote."

I can't seem to figure out the design pattern required. I have a MainScreen class and a DeckScreen class. In the MainScreen class I have two buttons that say Jokes and Thoughts. In the DeckScreen I have a custom view called DeckView class. How do I make the DeckView draw one or two decks (aka images) depending on which one I select.

Please ask me further if you don't understand my question. I would be happy to explain better.