Open KC-218 opened 2 years ago
Sorry, my app crash and get this error. And this is my code.
@objc protocol Animal { var name: String { get } @objc optional var running: Bool { get } } class Horse: Animal { let name: String let running: Bool init(name: String, running: Bool) { self.name = name self.running = running } convenience init(name: String) { self.init(name: name, running: false) } } class ResolverParameterInjectionVC: UIViewController, Resolving { override func viewDidLoad() { super.viewDidLoad() let smallHorse: Animal = Resolver.resolve(name: "small", args: "Spirit") let bigHorse: Animal = Resolver.resolve(name: "big", args: ["name": "Lucky", "running": true]) } } extension Resolver { public static func registerResolverParameterInjectionVC() { register { (_, args) in Horse(name: args.get()) }.implements(Animal.self, name: "small") register { (_, args) in Horse(name: args("name"), running: args("running")) }.implements(Animal.self, name: "big") } }
1
这是来自QQ邮箱的自动回复邮件。 邮件已收到
Sorry, my app crash and get this error.
And this is my code.