ClintJang / JWSTableViewAutomaticDimensionSwift

Swift version of JWSTableViewAutomaticDimension

Geek Repo:Geek Repo

Github PK Tool:Github PK Tool

JWSTableViewAutomaticDimensionSwift

License Swift 4

Description

Just TableView UITableViewAutomaticDimension Sample...

(UITableViewAutomaticDimension is used to check whether the Cell UI is well reflected.)

Info

Result Image

Source

  • ViewController.swift


    override func viewDidLoad()
    {
        super.viewDidLoad()
        
        // Self-Sizing Table View Cells 
        // These two lines of code will dynamically render the cell size.
        // estimatedRowHeight : Setting the expected value, Default 0, but setting it to 1 causes an error. Let it be 2 or more
        self.tableView.estimatedRowHeight = 44.0
        self.tableView.rowHeight = UITableViewAutomaticDimension
    }

About

Swift version of JWSTableViewAutomaticDimension

License:MIT License


Languages

Language:Swift 100.0%