kentya6 / KYCircularProgress

Flexible progress bar written in Swift.
MIT License
1.15k stars 115 forks source link

Unable to Set Colors #3

Closed bendytree closed 10 years ago

bendytree commented 10 years ago

When I set colors on the circularProgress view, I get a runtime error. I also get the error when I run the sample project. For example:

//the exception happens when I do this
circularProgress.colors = [0xFFF77A, 0xF3C0AB];

Here is the error:

KYCircularProgress.swift Line 60. self.gradientLayer.colors = convertedColors fatal error: array element cannot be bridged to Objective-C

kentya6 commented 10 years ago

What's your development environment? I tried iOS7.1 and iOS8.0 on Xcode6.1 about your error, but I can't cause this problem. Just to be safe, I modified convertedColors type from CGColor to AnyObject. (see https://github.com/kentya6/KYCircularProgress/commit/aa0dac94681fd6b30c767659b575cdc3f1614daa) Please check out my repository again, and rerun sample project.

bendytree commented 10 years ago

Thanks, that fixed it. I was able to run the sample project.

I was running iOS8.0 on XCode 6.0.1.

kentya6 commented 10 years ago

That's good.