Skip to content

A modular swift project. Component-based. Modules-based.组件化,swift组件化,swift4,swift模块化,iOS组件化,模块化,组件化,组件开发,模块,模块开发

License

Notifications You must be signed in to change notification settings

XychloveFhy/swiftProject

Folders and files

NameName
Last commit message
Last commit date

Latest commit

 

History

70 Commits
 
 
 
 
 
 
 
 
 
 

Repository files navigation

SwiftProject

最彻底的组件化
正在进行中, 逐渐完善文档和项目
可能本仓库长期不更新, 但是组件在更新, 经常pod update下关注
组件仓库:https://github.com/NJHu/NJSpecs.git

GitHub: NJHu | 简书: NJHu | Blog: NJHu | Email: [email protected]

模块交互

实线表示依赖和调用, 虚线表示动态调用

项目结构

一切皆组件, 组件皆一切

  • 1, 主工程只需要拥有 NJAppDelegate 和 NJTabBarController.

  • 2, 其他所有的功能都在相应的组件里边

NJTabBarController

// MARK: - 添加模块
extension NJTabBarController {
    private func addChildVcs() -> Void {
        let nav0 = NJMediator.sharedMediator.Mediator_DYLiveShow_MainController()
        if nav0 != nil {
            self.addChildViewController(nav0!)
        }
        let nav1 = NJMediator.sharedMediator.Mediator_DYTrends_MainController()
        if nav1 != nil {
            self.addChildViewController(nav1!)
        }
    }
}

Podfile

def release_remote_pods
    
    source 'https://github.com/NJHu/NJSpecs.git' # NJ 私有源
    
    pod 'NJKit'
    pod 'NJMediator', :source => 'https://github.com/NJHu/NJSpecs.git'
    
    pod 'DYTrends'
    pod 'NJMediator_DYTrends'
    
    pod 'DYLiveShow'
    pod 'NJMediator_DYLiveShow'
    
end

参考文章

About

A modular swift project. Component-based. Modules-based.组件化,swift组件化,swift4,swift模块化,iOS组件化,模块化,组件化,组件开发,模块,模块开发

Resources

License

Stars

Watchers

Forks

Packages

No packages published