I'am observing data in firebase, when this data changed, the collectionview reloads it's data, where I remove a label from the vertical stackview, I want to add this label again to the vertical stackview during runtime on some conditions, the vertical stackview is a part of a collectionview cell.
override func layoutSubviews() {
if(serviceUserCompany.text == ""){
detailsStackView.removeArrangedSubview(serviceUserCompany)
serviceUserCompany.isHidden = true
}
if(serviceUserCompany.text != "" && !detailsStackView.arrangedSubviews.contains(serviceUserCompany)){
detailsStackView.insertArrangedSubview(serviceUserCompany, at: 2)
}
}