edit the question- in the storyboard the uibutton's image changes according to selected and default state, and even in loading not all buttons look same
*@IBAction func topButtonTouched(_ sender: UIButton) {
if let delegate = self.delegate{
delegate.topButtonTouched(indexPath: indexPath)}
}
}
here is the expend option
func topButtonTouched(indexPath: IndexPath) {
if(screenType == .parameters){
isExpanded[indexPath.row] = !isExpanded[indexPath.row]
}else{
isExpanedErrors[indexPath.row] = !isExpanedErrors[indexPath.row]
}
// let cell = self.collectionView.cellForItem(at: indexPath) as! ExpendeableCollectionViewCell
UIView.animate(withDuration: 0.8, delay: 0.0, usingSpringWithDamping: 0.9, initialSpringVelocity: 0.9, options: UIViewAnimationOptions.curveEaseInOut, animations: {
}, completion: {
success in
self.collectionView.reloadItems(at: [indexPath])
})
}*
![[1]: https://i.stack.imgur.com/BAoPO.png](https://i.stack.imgur.com/efByB.png)