Try entering the code for the show and mapview tables:
Hide table view and table view in segmented ControlIndexChanged:
- (IBAction)segmentedControlIndexChanged { switch (self.segmentedControl.selectedSegmentIndex) { case 0: //it show tableview [UIView transitionWithView: self.view duration:1.0 options:UIViewAnimationOptionTransitionFlipFromLeft animations:^{ self.mapView.hidden = YES; self.tableView.hidden = NO; } completion:nil]; break; case 1: //it show mapview [UIView transitionWithView:self.view duration:1.0 options:UIViewAnimationOptionTransitionFlipFromLeft animations:^{ self.mapView.hidden = NO; self.tableView.hidden = YES; } completion:nil]; break; default: break; } }
source share