I am using a Horizontal CollectionView and UIButton embedded inside a Horizontal StackView. Button has a fixed Height and Width (say 50 X 50 )I want Stackview Width to be dynamic according to CollectionView contentsize. Please guide me through this.
This is what i want to Achieve
StackView Width should grow dynamially
Better way is to add cell in the last index of UICollectionView.
Here is the implementation
func collectionView(_ collectionView: UICollectionView, numberOfItemsInSection section: Int) -> Int {
return COUNT + 1
}
func collectionView(_ collectionView: UICollectionView, cellForItemAt indexPath: IndexPath) -> UICollectionViewCell {
if indexPath.row = COUNT{
return PLUSCELL
}else{
return NORMALCELL
}
}