enter image description hereenter image description here
I have added the two images(Both are different width iPhone one is 375width and another is 414width, I know design is messing up because of the height is given according to the width of the view ). As you can see I have a table view inside the table view there is a collection view horizontally scrolling and that collection view's cell is not showing perfectly in all devices. Because I'm giving height according to the width of the UIScreen(CGSize(width: UIScreen.main.bounds.size.width/2+120, height:UIScreen.main.bounds.size.width/2-200). Can Anybody let me know to set the aspect ratio of this view programmatically, I tried to find the tutorial about aspect ratio but there no completely written or explained tutorial.