无法转换类型为“ TyphoonDefinition”的值

时间:2019-06-18 15:18:47

标签: ios swift typhoon typhoondefinition

我无法在Swift中注入其他情节提要,而我正在使用Swift下面的Pod文件。

荚“台风”

错误:无法将类型'TyphoonDefinition'(0x10176fe80)的值强制转换为'UIStoryboard'(0x10e38bfb0)。

func appDelegate() -> UIApplicationDelegate? {
    return TyphoonDefinition.withClass(AppDelegate.self, configuration: { definition in
        definition?.injectProperty(#selector(Application.homeStoryboard), with: self.homeStoryboard())
        definition?.injectProperty(#selector(Application.loginStoryboard), with: self.loginStoryboard())
    }) as? UIApplicationDelegate
}**strong text**


@objc func homeStoryboard() -> UIStoryboard {
    return TyphoonDefinition.withClass(TyphoonStoryboard.self) {
        definition in

        definition?.useInitializer(#selector(TyphoonStoryboard.init(name:factory:bundle:)), parameters: { initializer in
            initializer?.injectParameter(with: "Home")
            initializer?.injectParameter(with: self)
            initializer?.injectParameter(with: Bundle.main)
        })
        } as! UIStoryboard
}

任何人都知道如何在Swift中用于注入属性。

0 个答案:

没有答案