SwiftyRSA icon indicating copy to clipboard operation
SwiftyRSA copied to clipboard

Type 'SwiftyRSA' has no member 'PublicKey'

Open ysoftware opened this issue 7 years ago • 1 comments

I have a class in my app called PublicKey. It is not related to RSA, I can not rename it and it should not be an issue.

I'm trying to create an object of SwiftyRSA.PublicKey but I get this error: Type 'SwiftyRSA' has no member 'PublicKey'.

Looking through the source code, I can see that SwiftyRSA is indeed an enum, so my code is not referring to the module.

Trying to initialize the object like this also doesn't help: SwiftyRSA.SwiftyRSA.PublicKey.

This question is probably more related to Swift but maybe you should think about renaming the enum to some other name so it wouldn't collide with the module name?

ysoftware avatar Dec 26 '18 07:12 ysoftware

Regarding this problem in Swift: https://bugs.swift.org/browse/SR-5304

Somebody there suggested adding typealias inside the framework, so I managed to compile my code by adding this inside PublicKey.swift public typealias SwiftyRSAPublicKey = PublicKey

So this worked: let publicKey = try! SwiftyRSAPublicKey(base64Encoded: string)

ysoftware avatar Dec 26 '18 08:12 ysoftware