I've used the ability to extend types with static members that return Self, so you can use leading dot syntax, for like ever.
extension String {
static let stringyDingyDoo = "doo"
}
let string: String = .stringyDingyDoo
But, inspired by all the organizational fun we have these days due to SE-0299, I only recently thought to try this:
extension String {
enum Stringy {
enum Dingy {
static let doo = "doo"
}
}
}
let string: String = .Stringy.Dingy.doo
That's awesome. Could you always do that?