Protocols

The following protocols are available globally.

  • The Autowired protocol is registered automatically, and load the required dependencies from IoC container.

    See more

    Declaration

    Swift

    public protocol Autowired : Inject
  • The AutowiredFactory protocol is registered automatically, and load the required dependencies from IoC container.

    It requires a payload, so is registered as a prototype scope.

    See more

    Declaration

    Swift

    public protocol AutowiredFactory : Factory
  • The class, struct, and protocol that inheritance Component protocol is registered IoC Container automatically.

    See more

    Declaration

    Swift

    public protocol Component : Inject
  • The ConfigProperty protocol is registered automatically, and load the configuration properties from property files.

    When injecting an object that inherits this protocol, it will always inject the newly created object(like Scope.prototype). Therefore, recommended implementing as struct-type.

    For example, this ServerConfig struct injects data corresponding to the “server” key of the property.

    struct ServerConfig: ConfigProperty {
        let target: String = "server"
    
        let url: String
    }
    
    See more

    Declaration

    Swift

    public protocol ConfigProperty
  • The Configuration protocol makes the user can register Resolver.

    See more

    Declaration

    Swift

    public protocol Configuration : Inject
  • The Factory protocol supports type-inference of the compiler for the payload.

    See more

    Declaration

    Swift

    public protocol Factory : Inject
  • The Inject protocol is the supporter that injects the dependency type.

    It is not registered in IoC conatiner, but is registered in Graph at the time of build, and checks whether there is an invalid reference.

    See more

    Declaration

    Swift

    public protocol Inject
  • The LazyAutowired protocol is registered automatically, and lazily load the required dependencies from IoC container.

    See more

    Declaration

    Swift

    public protocol LazyAutowired : Inject
  • The AutowiredFactory protocol is registered automatically, and lazily load the required dependencies from IoC container.

    It requires a payload, so is registered as a prototype scope.

    See more

    Declaration

    Swift

    public protocol LazyAutowiredFactory : Factory
  • Internal access protocol.

    Declaration

    Swift

    public protocol _Payload
  • The Payload protocol is a set of user parameters.

    This protocol inheritance to support type-inference of the compiler.

    See more

    Declaration

    Swift

    public protocol Payload : _Payload