I have written before that it is relatively simple to achieve thermal replanting of InjectionLLL under non-componentization. This article is mainly about how to use injectionIII to achieve thermal replanting under componentization
The previous steps of componentization and non-componentization can be moved to
Thermogravimetric InjectionIII
How to configure injectionLLL for componentization items
1. Create an xxx.xcworkspace shortcut in the project’s primary directory:
2. Injectionlll Open the upper directory of the selected project directory:
3. Add the above two steps to injectionLll as follows:
4. After adding it, I found that the injected method in Swift was invalid. You need to register Notification_INJECTION_BUNDLE_NOTIFICATION, and then add code to the viewdidLoad method to reload the Notification_INJECTION_BUNDLE_NOTIFICATION. Because RXSwift was used in the previous project, the processing is as follows:
NotificationCenter.default.rx.notification(Notification.Name(Notification_INJECTION_BUNDLE_NOTIFICATION)).subcribe(onNex t:{ [weak self] (error) in self?.viewDidLoad() })Copy the code
Add the code you want to change in viewDidLoad(), then command + s.