Latest 1.0.1
Homepage https://github.com/lypcliuli/PartitionDemo
License MIT
Platforms ios 9.0
Frameworks UIKit
Authors

PartitionDemo

PartitionDemo 模块化、组件化 、CTMediator

*本demo集成了CTMediator做了一个简单的组件化演示,具体可以看官方的demo,后续会继续出使用用url、protocol等形式的组件化交互方案演示,大家一起学习。

为了不扩散太多分支,也是因为我懒,所有的模块拆分我都在这一个项目里做了,下载项目之后一定先pod update一下,然后打开项目看路径是很干净的。
模拟了三个模块:MainPartition、MePartition、TempPart,其中MainPartition、MePartition做个公有仓库(建议做成私有仓库 我懒才这么干的),TempPart模块没有抽成组件,而是放本地了文件了。

每个模块的组成:
1、每个模块都是一个UIViewController;
2、创建一个Target_action,继承自NSObject,因为CTMediator内部主要通过runtime机制实现(可以看源码,几百行);
3、创建一个分类Category,通过Category解耦(个人理解词汇);

Latest podspec

{
    "name": "MainPartition",
    "version": "1.0.1",
    "summary": "MainPartitionu6a21u5757",
    "description": "u672cu6a21u5757u7684u6e90u7801u548cu5bf9u5e94u7684u8ba9u5916u754cu8c03u7528u7684u4e00u4e2au7ee7u627fu673aNSObjectu7c7buff0cu6765u5b9eu73b0u4e00u4e2au521bu5efau5bf9u8c61u7684u65b9u6cd5 CTMediatoru5229u7528runtimeu81eau52a8u83b7u53d6u521bu5efau65b9u6cd5",
    "homepage": "https://github.com/lypcliuli/PartitionDemo",
    "license": {
        "type": "MIT",
        "file": "LICENSE"
    },
    "authors": {
        "lypcliuli": "[email protected]"
    },
    "source": {
        "git": "https://github.com/lypcliuli/PartitionDemo.git",
        "tag": "1.0.1"
    },
    "platforms": {
        "ios": "9.0"
    },
    "frameworks": "UIKit",
    "subspecs": [
        {
            "name": "Controller",
            "source_files": "MainPartition/Controller/*",
            "public_header_files": "MainPartition/Controller/*.h"
        },
        {
            "name": "Target_MainPartition",
            "source_files": "MainPartition/Target_MainPartition/*",
            "public_header_files": "MainPartition/Target_MainPartition/*.h",
            "dependencies": {
                "MainPartition/Controller": []
            }
        }
    ]
}

Pin It on Pinterest

Share This