I want to expand the row height and show the content inside. I show my content in view I want when I tap on a cell it should expand like showed in the image
Table height can only be changed through delegates there is no other way to do it i will show you a simple way to do it.
Declare variable
var selectedIndex = NSIndexPath()
Inside didSelectRowAtIndexPath reload selected cell
func tableView(tableView: UITableView, didSelectRowAtIndexPath indexPath: NSIndexPath) {
selectedIndex = indexPath
tableView.reloadRowsAtIndexPaths([indexPath], withRowAnimation: UITableViewRowAnimation.Fade)
}
Inside heightForRowAtIndexPath return size
func tableView(tableView: UITableView, heightForRowAtIndexPath indexPath: NSIndexPath) -> CGFloat {
if indexPath == selectedIndex {
return 100 //Size you want to increase to
}
return 50 // Default Size
}