Set one section height is constant and other sections height will be dynamic iOS swift

 Problem:

I want to set one section height was static and other section heights will be dynamic.How can i achieve that?


Solution:

func tableView(_ tableView: UITableView, heightForRowAt indexPath: IndexPath) -> CGFloat {

        switch indexPath.section {

        case 0:

            return 55

        default:

            return UITableView.automaticDimension

        }

    }

Comments

Popular posts from this blog

Invalid bundle error while upload the app to the app Store

Saved Image in document directory and save path in coredata not able to fetch the image file iOS swift