image1 image I have a screen contains table view and segment control that has 3 indexes every index call an api that return array of movies . I displayed the movies on table view and put all the components of the screen in scroll view and set its constraint very well .And i ran my app and it worked well. the problem caused when i make rotation for my device the data in table view disappeared if any one can help me ?
i created a variable from height of table view constraint to change it based on the array of movies that come from api . I tried to change the height of scroll view and its content and used ViewDidLayoutViews() function to update the height but the problem still .
override func viewDidLayoutSubviews() {
super.viewDidLayoutSubviews()
scrollviewhight.constant = movieListTableView.contentSize.height
}