             stackView.translatesAutoresizingMaskIntoConstraints = false
             return stackView
         }()
+        
+//        profileTableHeader.addSubview(headerStackView)
+        
+        //
+        // Adjust header container view height
+        //
+        
+//        let headerHeight = userImageView.bounds.size.height + userTitleLabel.bounds.size.height + userBioLabel.bounds.size.height + 32
+        
+//        let headerHeight = headerStackView.bounds.size.height + 32
+//        
+//        print("Adjusted header height is: \(headerHeight)")
+        
+        var baseHeaderHeight = 105.0
+        
+        if let titleText = userTitleLabel.text where !titleText.isEmpty {
+            
+            baseHeaderHeight += 20.0
+            
+        }
+        
+        if let bioText = userBioLabel.text where !bioText.isEmpty {
+            
+            baseHeaderHeight += 34.0
+            
+        }
+        
+//        profileTableHeader.frame.size.height = headerHeight
+        
+        let headerHeight = CGFloat(baseHeaderHeight + 40.0)
+        
+        profileTableHeader.frame = CGRect(x: 0, y: 0, width: self.view.frame.width, height: headerHeight)
         
         profileTableHeader.addSubview(headerStackView)
         

            self.statGroupView.alpha = 1.0
        }
        
        //
        // Post count
        //

    
    lazy var profileTableHeader: UIView = {
        let view = UIView()
//        view.frame = CGRect(x: 0, y: 0, width: self.view.frame.width, height: 224)
        view.backgroundColor = UIColor(
            red: 245.0/255.0,
            green: 247.0/255.0,
