DIFramework
public protocol DIFramework : AnyObject
Slight expansion over part. Allows you to express more expressively the entry point to the framework of you application. It isn’t necessary to create several such classses on one framework - it willn’t be convenient.
-
bundle
Default implementationbundle which is a framework. Default picks based on where the class. But if the framework is statically link, it can be a problem, as all classes will be in the main bundle. To obtain the bundle name framework, used:
Bundle(path: Bundle.main.privateFrameworksPath! + "/" + {FRAMEWORK_NAME} + ".framework")
This is the unsafe code, but you can rewrite it.
Default Implementation
Default value
Declaration
Swift
static var bundle: Bundle { get }
-
Method inside of which you can registration a components. It’s worth combining the components for some reason. And call a class implementing the protocol according to this characteristics.
Declaration
Swift
static func load(container: DIContainer)
Parameters
container
A container. Don’t call the method yourself, but leave it to the method
append(...)
into container.