Q:

Button's image becoming longer in table view

I have strange problem with button's size in table view. I have table view with 4 cells. Every cell's size is This is a third of the screen size (minus navigation bar).
Top and button of table view
If I scroll down and click on fourth button (second, third, it doesn't matter because first button won't be visible) I will move to other VC. Then If I move to iOS Home Screen, and launch my app again and return to Table View I will see that table view is not fully scrolled down. It's not biggest problem because If I scroll up to the top of table view I will see that first button is much longer. How to resolve it? I've added constraints. 
Issue with table view and normal table view
 func tableView(_ tableView: UITableView, heightForRowAt indexPath: IndexPath) -> CGFloat {
    // get the height for the current view
    let viewHeight = self.view.frame.height

    // since we want 3 rows to appear at a time, simply divide the viewHeight by 3
    return viewHeight / 3
}

/*
// MARK: - Navigation

// In a storyboard-based application, you will often want to do a little preparation before navigation
override func prepare(for segue: UIStoryboardSegue, sender: Any?) {
    // Get the new view controller using segue.destinationViewController.
    // Pass the selected object to the new view controller.
}
*/

func numberOfSections(in tableView: UITableView) -> Int {

    return 1
}

func tableView(_ tableView: UITableView, numberOfRowsInSection section: Int) -> Int {
    return 4
}

func tableView(_ tableView: UITableView, cellForRowAt indexPath: IndexPath) -> UITableViewCell {
    // if the steps are selected, use those cell identifiers and configure them
    if indexPath.row == 0 {
        let cell = tableView.dequeueReusableCell(withIdentifier: "Cell1") as! ButtonTableViewCell
        cell.buttonVC.backgroundColor = UIColor.blue

        return cell
    } else if indexPath.row == 1 {
        let cell = tableView.dequeueReusableCell(withIdentifier: "Cell2") as! ButtonTableViewCell

        cell.buttonVC.backgroundColor = UIColor.green
        return cell
    } else if indexPath.row == 2 {
        let cell = tableView.dequeueReusableCell(withIdentifier: "Cell3") as! ButtonTableViewCell

        cell.buttonVC.backgroundColor = UIColor.brown
        return cell
    } else {
        let cell = tableView.dequeueReusableCell(withIdentifier: "Cell4") as! ButtonTableViewCell

        cell.buttonVC.backgroundColor = UIColor.yellow
        cell.selectionStyle = .none
        return cell
    }
}

A:

My problem is resolved with changing viewHeight
let viewHeight = UIScreen.main.bounds.size.height - (self.navigationController?.navigationBar.frame.size.height)! - UIApplication.shared.statusBarFrame.height

