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

Convert NsNumber, NSDate to String in iOS Swift

Global LocationManager Singleton class iOS Swift