I have a basic class named APIGroup
that exists for the sole purpose of subclassing (it is not [yet] used for anything but certain static
properties that are accessed by the subclasses). It looks somewhat like this:
public class APIGroup {
public static let someProperty : String = "I am a property!"
}
And I have a subclass, Track
, which defines a type method search
as follows:
public class Track : APIGroup {
public static func search(name: String) -> Void {
print("Track search initiated. Name: \(name)")
print("And the property is: \(someProperty)")
}
}
These two classes are defined in separate files in the same module. In another target, I import the module and try to call:
import MyModule
MyModule.Track.search("testing...")
But this throws: Type 'Track' has no member 'search'
. What am I doing wrong?
Putting this code in a Playground works fine for me:
If they are in the same module you do not need to import or use the module name.