I have TableViewController with multiple cells. I am setting the height of these cells in the heightForRowAt method:
override func tableView(_ tableView: UITableView, heightForRowAt indexPath: IndexPath) -> CGFloat {
return UIScreen.main.bounds.maxY / 15
}
When the device orientation is portrait, everything is working fine, but when its landscape, maxY is very small, so the cells are too small as well. I want them to have the same height whatever the orientation is. So how do I get the portrait device height even if the current orientation is landscape?