Sorry, if I search for “namespace” or “namespacing” in Swift-eBook, there are no results. Maybe you can give me a link to an additional resource?
I would solve your problem simply using the struct and static functions.
Classa
struct ClassA { static func localize() { println("Localized String") } }
Classb
You can remove the import and execute the ClassA function as follows:
ClassA.localize()
Second way
In your case, you can also just do a line extension like this:
extension String { func localize() -> String { return self+"-localized" } } println("Test".localize())
source share