Closed JetForMe closed 1 year ago
My suggestion is to rename the type in the client code or just use TeslaSwift.Vehicle
when needed
You can't use TeslaSwift.Vehicle
because Swift finds the TeslaSwift
class, not the module. There's a way to alias module names when building a Package.swift project, but this doesn't work for an Xcode project.
And asking the client to change their class type is not really tenable either. The fix is literally one line, but it has to be in your library.
If client code defines a
Vehicle
type, then it becomes impossible to distinguish between aTeslaSwift.Vehicle
and aClient.Vehicle
.Adding
typealias TeslaSwiftVehicle = Vehicle
to your library should alleviate this.Alternatively, change the name of either the library or the TeslaSwift class.