#DynaMon - The Elegant Way to make Modularized App
DynaMon is a very simple way to make App Modularization.
- Easy to use
- Less code
##Using:
###In Main Project:
-
Put
DynaMon.swift
in it. -
Set
DynaMon.shared
at AppDelegate,like
var dynaMon = DynaMon.shared
###In Framework:
-
Add
DynaMonRegister.h
andDynaMonRegister.m
into the framework. -
Modify the
className
andclass
at theDynaMonRegister.m
#define className @"demo" #define class @"DemoModuleViewController"
-
Expose the class of framework you want to register to Obj-C:
@objc(DemoModuleViewController) //IMPORTANT public class DemoModuleViewController: UIViewController { //REMEMBER TO SET PUBLIC }
###How to get registered object:
In main app:
let a = ModuleService.sharedInstance.getObject(name: "demo") as! UIViewController
a.view.backgroundColor = .white
present(a, animated: true, completion: nil)
For more details, please check the source code.