You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
Extensions - add additional capabilities, in runtime. Needs for other libraries
class VC: UIViewController {
var presenter: Presenter!
}
// where get arg1?
class Presenter {
let server: Server!
let arg1: Int
init(server: server, arg1: Int) {
self.server = server
self.arg1 = arg1
}
}
showVC() {
let runtimeArg1 = 125
let runtimeArg2 = 125
// extension variable need for retain Extension
let extension = DIExtensions.resolve(filter: Presenter.self) { container in
return Presenter(server: try! *container, arg1: runtimeArg1)
} // if somebody resolve Presenter, then call extension
// or
let extension = DIExtensions.initial(filter: Presenter.self) { container in
return Presenter(server: try! *container, arg1: runtimeArg1)
} // if from somewhere get Presenter, then call extension
let extension = DIExtensions.postInit(filter: Presenter.self) { container, presenter in
presenter.arg2 = runtimeArg2
} // if Presenter full create, then call extension
let vc = storyboard.in...()
}
The text was updated successfully, but these errors were encountered:
Extensions - add additional capabilities, in runtime. Needs for other libraries
The text was updated successfully, but these errors were encountered: