I have an interesting problem with two different Cocoapods that have a public listing with the same name.
An implicit namespace is usually not a problem, except that both Cocoapods have a class that matches their target name.
So, if I import both Cocoapods into the same file referencing an enumeration with the same name, it generates an "enumeration name ambiguously for type search in this context", and if I try to reference an enumeration using ModuleName.enum Swift, ModuleName does not have a member named enum.
Presumably this is because the class, and not the namespace, does not have a member named enum. Does anyone know about this?
Here's what it looks like in the code:
Cocoapod A:
public enum Test { } public class A { }
Cocoapod B:
public enum Test { } public class B { }
Another file:
import A import B // Results in "A does not have a member named Test" var test: A.Test = A.Test(rawValue: "a") // Results in "Test is ambiguous for type lookup in this context" var test: Test = Test(rawValue: "a")
source share