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.

28 lines
880 B

2 years ago
  1. import Foundation
  2. @objc
  3. public protocol SwinjectStoryboardProtocol {
  4. /// Called by Swinject framework once before SwinjectStoryboard is instantiated.
  5. ///
  6. /// - Note:
  7. /// Implement this method and setup the default container if you implicitly instantiate UIWindow
  8. /// and its root view controller from "Main" storyboard.
  9. ///
  10. /// ```swift
  11. /// extension SwinjectStoryboard {
  12. /// @objc class func setup() {
  13. /// let container = defaultContainer
  14. /// container.register(SomeType.self) {
  15. /// _ in
  16. /// SomeClass()
  17. /// }
  18. /// container.storyboardInitCompleted(ViewController.self) {
  19. /// r, c in
  20. /// c.something = r.resolve(SomeType.self)
  21. /// }
  22. /// }
  23. /// }
  24. /// ```
  25. @objc optional static func setup()
  26. }