Skip to content

Instantly share code, notes, and snippets.

@OhhhThatVarun
Created March 16, 2021 14:08
Show Gist options
  • Save OhhhThatVarun/2ce18a0a2a447402d09ab4b1a2534e71 to your computer and use it in GitHub Desktop.
Save OhhhThatVarun/2ce18a0a2a447402d09ab4b1a2534e71 to your computer and use it in GitHub Desktop.
SwDin: Loading modules.
import SwDin
@UIApplicationMain
class AppDelegate: UIResponder, UIApplicationDelegate {
func application(_ application: UIApplication, didFinishLaunchingWithOptions launchOptions: [UIApplication.LaunchOptionsKey: Any]?) -> Bool {
...
SwDin.start(modules: [module])
// or SwDin.start(modules: [module], attachLogger: true)
}
}
// OR
class FirstViewController: UIViewController {
override func viewDidLoad() {
super.viewDidLoad()
loadModule(module: module)
// or loadModules(modules: [module1, module2])
}
deinit() {
unloadModule(module: module)
// or unloadModules(modules: [module1, module2])
}
}
// OR
class MyRandomClass: SwDinComponent {
init() {
loadModule(module: module)
// or loadModules(modules: [module1, module2])
}
deinit() {
unloadModule(module: module)
// or unloadModules(modules: [module1, module2])
}
}
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment