Question

I have 2 UIViews into a UIView. I'm using this because I want to show an object and if is photo type or text type, I'm using a view or other. Using this I can do it with only one segue, and not 2 going to 2 different viewControllers.

enter image description here

It's a good practise or I have to create 2 viewControllers and make 2 segues?

I'm using hidden properties to hide or show views. self.photoView.hidden = YES; self.textView.hidden = NO;

Thanks!!

Was it helpful?

Solution

This is a good practice but you should use a state pattern
Make sure that you show only one at the time and handle hide and show updates. In your situation you have one view and 2 subviews. This is totally fine. But if you get more complex View structure maybe it's better to make 2 separate viewControllers or one ViewController but with 2 custom Views.

Licensed under: CC-BY-SA with attribution
Not affiliated with StackOverflow
scroll top