     
     func updateUI() {
         tableView.reloadData()
+        tableView.layoutIfNeeded()
         
         updateLinesCountLabels()
         updateContentLayout()

        if diff > 0 {
            let offsetY = diff + Layout.magicNumber
            let bottomOffset = CGPoint(x: currentOffsetX, y: offsetY)
            tableView.setContentOffset(bottomOffset, animated: false)
        }
    }
    

    
    var isOnScreen = false {
        didSet {
            if isOnScreen {
                self.updateUI()
            }
            isHidden = !isOnScreen
        }
    }
    
