hmlongco / Resolver

Swift Ultralight Dependency Injection / Service Locator framework
MIT License
2.14k stars 187 forks source link

fix: use explicit type assertion #149

Closed GaeaUni closed 2 years ago

GaeaUni commented 2 years ago

resolver.register(NSObject.self) { return UIView() }

let o = resolver.resolve(NSObject.self)

if explicit use type assertion ,the result will crash, but I really need it be NSObject

hmlongco commented 2 years ago

This is in the current branch. Will be in next release.