ivlevAstef / DITranquillity

Dependency injection for iOS (Swift)
MIT License
423 stars 32 forks source link

Remake name and tags on new syntax #121

Closed ivlevAstef closed 6 years ago

ivlevAstef commented 6 years ago
struct DITags {
  fileprivate init() { }
}

extension DITags {
  var tag1: Void { return () }
  var tag2: Void { return () }
}

extension DITags {
  var name: String { return "MainStoryboard" }
}

let path1 = \DITags.tag1
print(path1)

let path2 = \DITags.tag2
print(path2)

let path1_1 = \DITags.tag1
print(path1_1)

print(path1 == path2) // false
print(path1 == path1_1) // true

let namePath = \DITags.name

print(DITags()[keyPath: namePath]) // MainStoryboard
ivlevAstef commented 6 years ago

not works :(