kaandedeoglu / KDCircularProgress

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

ObjC - setColors / progressColors not found #109

Closed tamir-maoz closed 5 years ago

tamir-maoz commented 5 years ago

Hi, upgraded version from 1.5.2 to 1.5.4. i have a mix ObjC/Swift project and i'm unable to set the progress colors from my ObjC classes. getting the following error: "Property 'progressColors' not found on object of type 'KDCircularProgress *'" also unable to use set(colors:) or any other function i found to set the progress colors. am i missing anything ? how should i set the progress colors from my objC classes ? Thanks.

kaandedeoglu commented 5 years ago

Hey,

I've just pushed an update, can you please pod update and try again?

tamir-maoz commented 5 years ago

Hi, Thanks for the quick response. two things:

  1. I also noticed that "progress" property is also not found by objC classes edit: also can't find animateToAngle function
  2. should i pull a specific branch? currently i'm pulling pod 'KDCircularProgress' and see no updates...

Thanks again.

kaandedeoglu commented 5 years ago

This was a hotfix so I just moved tags forward. You might need to downgrade to 1.5.2 pod update and then re-upgrade to 1.5.4 followed by a final pod update

tamir-maoz commented 5 years ago

Hi, i have followed you suggestion but still same issues. i think the problem is with set(colors: UIColor...) func. it is the public version for set colors but UIColor... syntax is not supported by ObjC so the setter fails to get exposed to ObjC. Does it make sense?

regarding the rest of the unexposed functions / properties - not sure :/

Thanks.

kaandedeoglu commented 5 years ago

You can directly set to progressColors property. Like:

self.p.progressColors = @[[UIColor greenColor], [UIColor blueColor]];
tamir-maoz commented 5 years ago

This is exactly how i use it, see image attached: Screen Shot 2019-04-28 at 18 19 39

kaandedeoglu commented 5 years ago

Interesting, I just started a new Objective-C project and everything works for me. I had to uninstall - reinstall as stated above after pushing the fix. Are you sure you did that step?

image
tamir-maoz commented 5 years ago

Thanks for your support! Well, i just looked at your last commit (488603e40685007b5fdbec6ea15c452512a3a2db) on github that added: @objcMembers to KDCircularProgress class. however, i do not see that addition when i pull the repo via pods. i tried: force downgrade to 1.5.2 -> upgrade back to 1.5.4 remove KDCircularProgress from pod file -> re-adding KDCircularProgress to pod file

both resulted the same - no @objcMembers :(

kaandedeoglu commented 5 years ago

Okay, one more idea: please do pod cache clean 'KDCircularProgress' --all before doing the downgrade-upgrade dance

tamir-maoz commented 5 years ago

Hi @kaandedeoglu , I'm happy to say, clearing the pod cache did the trick! Your help is much appreciated, Thanks for the support.