0

I have a progress bar that is in a collectionviewcell. I want to add a border radius to the progress bar, but whenever I add the progress bar to the view controller, it says "Illegal configuration" and "The progressBar outlet from the ViewController to the UIProgressView is invalid. Outlets cannot be connected to repeating content."

@IBOutlet var progressBar: UIProgressView!

That line of code is what causes the error message.

jh95
  • 379
  • 2
  • 12

2 Answers2

1

You should put it inside the UICollectionViewCell and set the outlet with YourCollectionViewCell. Don't forgot to set the CustomClass name for your UICollectionViewCell in storyboard to make it into the effect.

class YourCollectinoViewCell: UICollectionViewCell {
  @IBOutlet var progressBar: UIProgressView!
}

Hope it helps!

Bhavin Kansagara
  • 2,866
  • 1
  • 16
  • 20
1

Answer from Bhavin Kansagara is correct, but also note that you can set corner radius in xib file like shown here Is it possible to set UIView border properties from interface builder?

Alexandra
  • 224
  • 2
  • 5