I have tab bar controller that show some items. And one item in tab bar controller have multiple view controller that show by a top tab bar. I already tried to make it with segment control and multiple container view but it didn't worked properly.
This is the storyboard that I want to make StoryboardExample
I want the three view controllers in the right show in View Controller 2 in item tab bar and control by the top tab bar. So, its like Activity Tab in Youtube Application that have top tab bar with item Shared and Notifications. Shared View in Youtube Application , Notification View in Youtube Application
Edit
This is the code to change the view from segment control,
@objc func changeGroup(sender: UISegmentedControl)
{
if sender.numberOfSegments == 3
{
switch sender.selectedSegmentIndex
{
case 0 :
if self.groupView.isHidden == true
{
self.groupView.isHidden = false
}
if self.inspirationView.isHidden == false
{
self.inspirationView.isHidden = true
}
if self.pesantrenView.isHidden == false
{
self.pesantrenView.isHidden = true
}
case 1:
if self.groupView.isHidden == false
{
self.groupView.isHidden = true
}
if self.inspirationView.isHidden == true
{
self.inspirationView.isHidden = false
}
if self.pesantrenView.isHidden == false
{
self.pesantrenView.isHidden = true
}
case 2:
if self.groupView.isHidden == false
{
self.groupView.isHidden = true
}
if self.inspirationView.isHidden == false
{
self.inspirationView.isHidden = true
}
if self.pesantrenView.isHidden == true
{
self.pesantrenView.isHidden = false
}
default :
break
}
}
}