Google News
logo
IOS - Interview Questions
How to maintain the height of tableview dynamically?
To provide the height of tableview according to the content height, return UITableView.automaticDimension in heightForRowAt delegate method. Consider the following syntax.
public func tableView(_ tableView: UITableView, heightForRowAt indexPath: IndexPath) -> CGFloat {    
      return UITableView.automaticDimension    
  }  
Advertisement