PINRemoteImage icon indicating copy to clipboard operation
PINRemoteImage copied to clipboard

Impossible use setPin_updateWithProgress in Swift

Open ezefranca opened this issue 10 years ago • 7 comments

Because the name of the class, its impossible to import in Swift.

ezefranca avatar Aug 22 '16 19:08 ezefranca

@ezefranca I believe it's the correct way to provide a property override for a category method which has a prefix in Objective-C. Any ideas for a solution?

garrettmoon avatar Aug 22 '16 19:08 garrettmoon

It's one solution. But another approach are use the Macro NS_SWIFT_NAME https://developer.apple.com/library/ios/documentation/Swift/Conceptual/BuildingCocoaApps/MixandMatch.html

ezefranca avatar Aug 22 '16 20:08 ezefranca

Neat! Would you be interested in putting up a PR to fix? I'd happily review :)

garrettmoon avatar Aug 22 '16 20:08 garrettmoon

i seem to be able to set it via imageView.pin_updateWithProgress = true

lukeivers avatar Sep 14 '16 20:09 lukeivers

@ezefranca does lukeivers' solution work for you? If not would you be willing to provide a test app that shows the issue?

garrettmoon avatar Sep 21 '16 23:09 garrettmoon

@ezefranca You have to use imageView.pin_updateWithProgress = true as @lukeivers said. The reason is that it's declared as a property in PINRemoteImageCategory and not as a method:

@property (nonatomic, assign) BOOL pin_updateWithProgress;

maicki avatar Sep 29 '16 03:09 maicki

@ezefranca Going to close this now, please let me know if there's something that still needs to be done.

garrettmoon avatar Sep 29 '16 17:09 garrettmoon