             headerView.addSubview(userBioLabel)
             
         }
+        
+//        headerView.addSubview(headerStackView)
         
 //        headerView.sizeToFit()
         

        }
        
        // Display user's title
        if self.userProfile!["properties"]["title"].string != "" {
            
            let userTitleLabel = UILabel(frame: CGRect(x: 0, y: 0, width: self.view.frame.width, height: 24))
            
            userTitleLabel.center = CGPoint(x: 160, y: 112)
            userTitleLabel.textAlignment = .Center
            userTitleLabel.font = UIFont.systemFontOfSize(15, weight: UIFontWeightRegular)
            
            userTitleLabel.text = self.userProfile!["properties"]["title"].string
            
            headerView.addSubview(userTitleLabel)
            
        }
        
        // Display user's organization name
        if self.userProfile!["properties"]["organization_name"].string != "" {
            
            let userOrganizationNameLabel = UILabel(frame: CGRect(x: 0, y: 0, width: self.view.frame.width, height: 24))
            
            userOrganizationNameLabel.center = CGPoint(x: 160, y: 124)
            userOrganizationNameLabel.textAlignment = .Center
            userOrganizationNameLabel.font = UIFont.systemFontOfSize(15, weight: UIFontWeightRegular)
            
            userOrganizationNameLabel.text = self.userProfile!["properties"]["organization_name"].string
            
            headerView.addSubview(userOrganizationNameLabel)
            
        }
        
        // Display user's description/bio
        if self.userProfile!["properties"]["description"].string != "" && self.userProfile!["properties"]["description"].string != "Bio" {
            
            let userBioLabel = UILabel(frame: CGRect(x: 0, y: 0, width: 272, height: 32))
            
            userBioLabel.center = CGPoint(x: 160, y: 160)
            userBioLabel.textAlignment = .Left
            userBioLabel.font = UIFont.systemFontOfSize(13, weight: UIFontWeightRegular)
            userBioLabel.numberOfLines = 3
            userBioLabel.lineBreakMode = .ByTruncatingTail
            
            userBioLabel.text = self.userProfile!["properties"]["description"].string

            alpha: 1.0
        )
        
//        let margins = self.view.layoutMarginsGuide
        
//        headerView.leadingAnchor.constraintEqualToAnchor(self.submissionTableView.leadingAnchor, constant: 0.0).active = true
//        
//        headerView.trailingAnchor.constraintEqualToAnchor(self.submissionTableView.trailingAnchor, constant: 0.0).active = true
        
        //
        // Default vertical offsets for header components
        //
        
        let userTitleYOffset = 122
//        let organizationNameYOffset = 124
        let userBioYOffset = 160
        
//        let headerStackView = UIStackView()
//        
//        headerStackView.axis = .Vertical;
//        headerStackView.distribution = .EqualSpacing;
//        headerStackView.alignment = .Center;
//        headerStackView.spacing = 10;
        
//        headerView.addSubview(headerStackView)
//        
//        headerStackView.leadingAnchor.constraintEqualToAnchor(headerView.leadingAnchor).active = true
//        headerStackView.trailingAnchor.constraintEqualToAnchor(headerView.trailingAnchor).active = true
//        headerStackView.topAnchor.constraintEqualToAnchor(headerView.topAnchor).active = true
//        headerStackView.bottomAnchor.constraintEqualToAnchor(headerView.bottomAnchor).active = true
        
        let userImageView = UIImageView()
        
        userImageView.frame = CGRect(x: 0, y: 0, width: 64, height: 64)
        
//        userImageView.heightAnchor.constraintEqualToConstant(64.0).active = true
//        userImageView.widthAnchor.constraintEqualToConstant(64.0).active = true
        
        userImageView.center = CGPoint(x: 160, y: 48)
        
