You can not select more than 25 topics Topics must start with a letter or number, can include dashes ('-') and can be up to 35 characters long.

27 lines
939 B

2 years ago
  1. //
  2. // Copyright © 2019 Swinject Contributors. All rights reserved.
  3. //
  4. /// The `Assembly` provides a means to organize your `Service` registration in logic groups which allows
  5. /// the user to swap out different implementations of `Services` by providing different `Assembly` instances
  6. /// to the `Assembler`
  7. public protocol Assembly {
  8. /// Provide hook for `Assembler` to load Services into the provided container
  9. ///
  10. /// - parameter container: the container provided by the `Assembler`
  11. ///
  12. func assemble(container: Container)
  13. /// Provides a hook to the `Assembly` that will be called once the `Assembler` has loaded all `Assembly`
  14. /// instances into the container.
  15. ///
  16. /// - parameter resolver: the resolver that can resolve instances from the built container
  17. ///
  18. func loaded(resolver: Resolver)
  19. }
  20. public extension Assembly {
  21. func loaded(resolver _: Resolver) {
  22. // no-op
  23. }
  24. }