i have uitabelviewcontroller custom myuitableviewcell. myuitableviewcell class has @iboutlet mytextview:uitextview , method:
func getheight() -> cgfloat { let height = (self.mytextview?.contentsize)!.height return height }
i need set high cell depend textview content size. in uitabelviewcontroller set high tableviewcell:
override func tableview(_tableview: uitableview, estimatedheightforrowatindexpath indexpath: nsindexpath) -> cgfloat { let cell = tableview(_tableview, cellforrowatindexpath: indexpath) println(cell.getheight()) return cell.getheight() }
but println show 20.0 cells on output, although see real cell high in table different.
simply check uitableview
's rowheight
method, this:
tableview.rowheight