Created
March 16, 2021 14:08
-
-
Save OhhhThatVarun/2ce18a0a2a447402d09ab4b1a2534e71 to your computer and use it in GitHub Desktop.
SwDin: Loading modules.
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
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