kaandedeoglu / KDCircularProgress

A circular progress view with gradients written in Swift
MIT License
1.21k stars 217 forks source link

Crashing when no width and height constraints set #12

Closed sneps85 closed 9 years ago

sneps85 commented 9 years ago

When no height and width constraint is set on the IB, but instead top,right,bottom,left constraints in combination with a aspect ratio constraint, the following code causes the crash:

let g = CGGradientCreateWithColorComponents(baseSpace, componentsArray, locations,componentsArray.count / 4) self.gradientCache = g gradient = g!

as g is nil.

Do i have to set height and width in the interface builder?

kaandedeoglu commented 9 years ago

Hello,

I just constructed a similar example in IB that seems to run just fine

I also tried creating an instance of KDCircularProgress with CGRectZero as the frame. That did not cause any problems either.

Please create an example project that crashes for me to look at. Please feel free to reopen this when you get a reproducible example.

Thank you :)

screen shot 2015-10-07 at 4 28 27 pm